我有一个Excel文件,其中有一些西班牙字符(波浪号等),我需要将其转换为CSV文件作为导入文件使用。然而,当我将另存为CSV时,它会破坏不是ASCII字符的“特殊”西班牙字符。它似乎也这样做的左右引号和长破折号,似乎是来自最初的用户在Mac中创建Excel文件。
由于CSV只是一个文本文件,我确信它可以处理UTF8编码,所以我猜这是Excel的限制,但我正在寻找一种方法,从Excel到CSV,并保持非ascii字符完整。
我有一个Excel文件,其中有一些西班牙字符(波浪号等),我需要将其转换为CSV文件作为导入文件使用。然而,当我将另存为CSV时,它会破坏不是ASCII字符的“特殊”西班牙字符。它似乎也这样做的左右引号和长破折号,似乎是来自最初的用户在Mac中创建Excel文件。
由于CSV只是一个文本文件,我确信它可以处理UTF8编码,所以我猜这是Excel的限制,但我正在寻找一种方法,从Excel到CSV,并保持非ascii字符完整。
当前回答
简单的方法: 不需要Open office和谷歌文档
Save your file as "Unicode text file"; now you have an unicode text file open it with "notepad" and "Save as" it with selecting "utf-8" or other code page that you want rename file extension from "txt" to "csv". This will result in a tab-delimited UTF-8 csv file. If you want a comma-delimited file, open the csv file you just renamed and replace all tabs with commas. To do this in Notepad on Win 10, simply select one tab field then click Ctrl+H. In the window that opens, type a comma , in the "Replace with" field then click "Replace All". Save your file. The result will be a comma-delimited UTF-8 csv file.
不管怎样,不要用ms office打开它!! 现在您有了一个以制表符分隔的CSV文件。 或者,如果应用步骤5,则使用逗号分隔。
其他回答
“nevets1219”是正确的谷歌文档,然而,如果你只是“导入”文件,它通常不会将其转换为UTF-8。
但是如果您将CSV导入到现有的谷歌电子表格中,它会转换为UTF-8。
下面是一个食谱:
在主文档(或驱动器)屏幕上点击“创建”按钮并选择“电子表格” 在“文件”菜单中选择“导入” 按“选择档案” 选择“替换电子表格” 选择要用作分隔符的字符 点击“导入” 从“文件”菜单选择“下载为”-> CSV(当前文件)
生成的文件将是UTF-8格式的
我使用了以下解决方案:Mac Exel 2008 >文件>另存为格式,然后在格式下使用MS_DOS逗号分隔(.csv)。完美的工作。
在Excel 2016及更高版本(包括Office 365)中,有一个专门用于UTF-8格式的CSV选项。
在Office 365中,选择另存为;以前人们可能会选择CSV(逗号分隔),现在你可以保存为CSV UTF-8(逗号分隔)(*.csv)
简单的方法: 不需要Open office和谷歌文档
Save your file as "Unicode text file"; now you have an unicode text file open it with "notepad" and "Save as" it with selecting "utf-8" or other code page that you want rename file extension from "txt" to "csv". This will result in a tab-delimited UTF-8 csv file. If you want a comma-delimited file, open the csv file you just renamed and replace all tabs with commas. To do this in Notepad on Win 10, simply select one tab field then click Ctrl+H. In the window that opens, type a comma , in the "Replace with" field then click "Replace All". Save your file. The result will be a comma-delimited UTF-8 csv file.
不管怎样,不要用ms office打开它!! 现在您有了一个以制表符分隔的CSV文件。 或者,如果应用步骤5,则使用逗号分隔。
Microsoft Excel提供了一个使用Unicode编码导出电子表格的选项。请看下面的截图。