如何让 Excel 将文件另存为文本,支持 Unicode,并支持单元格内的多行(alt-enter)? [英] How to make Excel save a file as text, with support for Unicode, and support for multiple lines within a cell (alt-enter)?

查看:70
本文介绍了如何让 Excel 将文件另存为文本,支持 Unicode,并支持单元格内的多行(alt-enter)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的应用程序需要使用 Excel 通过文本文件来回传递数据.我的文本文件将包含 Unicode 文本,并且还需要某种方式来指示单元格内的多行(我认为这是 LF 字符 (ascii 10)).

My application needs to pass data back and forth via text files with Excel. My text files will have Unicode text, and will also need to have some way of indicating mulitple lines within a cell (which I believe is the LF character (ascii 10)).

Excel 可以正确读取我的 csv 文件.但是,当我将 csv 文件保存在 Excel 中时,它会用 ?'s 替换 Unicode 字符.因此,尽管它在 Excel 中看起来仍然不错,但如果我关闭 Excel 并使用 Excel 重新打开该文件,我会看到 ?'s 而不是我的 Unicode 字符.

Excel can read my csv file correctly. However, when I save the csv file in Excel, it replaces the Unicode characters with ?'s. So although it still looks fine in Excel, if I close Excel and re-open the file with Excel, I see ?'s instead of my Unicode characters.

如果不是将 Excel 保存为 csv,而是保存为 Unicode 文本,则会生成一个包含 Unicode 字符的制表符分隔文件.但是,如果我关闭文件并用 Excel 重新打开它,它会引导我通过一个无法识别 LF 字符(由 alt-enter 生成)的导入向导来指示单元格中的新行.相反,它将 LF 视为新行.

If instead of Excel saving as csv, I save as Unicode text, that produces a tab-delimited file that does have the Unicode characters. However, if I close the file and re-open it with Excel, it takes me through an import wizard that does not recognize the LF character (produced by alt-enter) to indicate a new line within a cell. Instead, it treats the LF as a new row.

如何让 Excel 以支持 Unicode 和单元格内多行的文本格式保存?

How can I get Excel to save in a text format that supports both Unicode and multiple lines within a cell?

推荐答案

要解决此问题,请不要从 Excel 中打开 .txt 文件.而是在文件资源管理器中右键单击该文件,然后选择使用 Excel 打开.

To get around this problem do not open the .txt file from Excel. Instead right click on the file in file explorer and choose open with Excel.

如果您使用 .xls 扩展名保存 .txt 文件,您可以在文件资源管理器中双击该文件以在 Excel 中打开.

If you save the .txt file with .xls extension you can double click on the file in file explorer to open in Excel.

从 Excel 打开

  • 点击文件/打开...
  • 选择要打开的 .txt 文件.
  • 点击打开按钮时按住 Shift 键.

这篇关于如何让 Excel 将文件另存为文本,支持 Unicode,并支持单元格内的多行(alt-enter)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆