[英]How to make Excel save a file as text, with support for Unicode, and support for multiple lines within a cell (alt-enter)?
My application needs to pass data back and forth via text files with Excel. 我的应用程序需要使用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)).
我的文本文件将具有Unicode文本,并且还需要某种方式来指示单元格中的多行(我相信这是LF字符(ascii 10))。
Excel can read my csv file correctly. Excel可以正确读取我的csv文件。 However, when I save the csv file in Excel, it replaces the Unicode characters with ?'s.
但是,当我将csv文件保存在Excel中时,它将用?代替Unicode字符。 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中看起来仍然不错,但是如果我关闭Excel并使用Excel重新打开文件,则会看到?而不是我的Unicode字符。
If instead of Excel saving as csv, I save as Unicode text, that produces a tab-delimited file that does have the Unicode characters. 如果不是将Excel另存为csv,而是另存为Unicode文本,则生成一个制表符分隔的文件,该文件确实包含Unicode字符。 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.
但是,如果我关闭文件并用Excel重新打开它,它将带我通过一个导入向导,该向导无法识别LF字符(由alt-enter产生)以指示单元格中的新行。 Instead, it treats the LF as a new row.
相反,它将LF视为新行。
How can I get Excel to save in a text format that supports both Unicode and multiple lines within a cell? 如何使Excel以支持Unicode和一个单元格中多行的文本格式保存?
To get around this problem do not open the .txt file from Excel. 要变通解决此问题,请不要从Excel打开.txt文件。 Instead right click on the file in file explorer and choose open with Excel.
而是右键单击文件资源管理器中的文件,然后选择“使用Excel打开”。
If you save the .txt file with .xls extension you can double click on the file in file explorer to open in Excel. 如果您以.xls扩展名保存.txt文件,则可以双击文件资源管理器中的文件以在Excel中打开。
To Open From Excel 从Excel打开
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.