我有一个Excel文件,其中有一些西班牙字符(波浪号等),我需要将其转换为CSV文件作为导入文件使用。然而,当我将另存为CSV时,它会破坏不是ASCII字符的“特殊”西班牙字符。它似乎也这样做的左右引号和长破折号,似乎是来自最初的用户在Mac中创建Excel文件。

由于CSV只是一个文本文件,我确信它可以处理UTF8编码,所以我猜这是Excel的限制,但我正在寻找一种方法,从Excel到CSV,并保持非ascii字符完整。


当前回答

我发现OpenOffice的电子表格应用程序Calc非常擅长处理CSV数据。

在“另存为…”对话框中,单击“格式选项”可获得CSV的不同编码。LibreOffice的工作原理与AFAIK相同。

其他回答

保存对话框>工具按钮> Web选项>编码选项卡

我使用了以下解决方案:Mac Exel 2008 >文件>另存为格式,然后在格式下使用MS_DOS逗号分隔(.csv)。完美的工作。

Easy way to do it: download open office (here), load the spreadsheet and open the excel file (.xls or .xlsx). Then just save it as a text CSV file and a window opens asking to keep the current format or to save as a .ODF format. select "keep the current format" and in the new window select the option that works better for you, according with the language that your file is been written on. For Spanish language select Western Europe (Windows-1252/ WinLatin 1) and the file works just fine. If you select Unicode (UTF-8), it is not going to work with the spanish characters.

您可以将excel保存为unicode文本,它是制表符分隔的。

另一种方法是在记事本中打开UTF-8 CSV文件,它将正确显示。 然后将所有的“,”替换为制表符。 将所有这些粘贴到一个新的excel文件中。