简体   繁体   English

将保留特殊字符的Excel文件转换为CSV特殊字符

[英]Converting an Excel file with special characters to a CSV with these preserved

I am trying to convert an Excel spreadsheet that contains some special characters such as "ñ" which are not preserved when I save as a CSV file using the simple 'save as > csv' approach in excel. 我正在尝试转换一个包含一些特殊字符(例如“ñ”)的Excel电子表格,当我使用excel中的简单“另存为> csv”方法将其另存为CSV文件时,这些电子字符不会保留。

Is there a method for doing this that will preserve these characters? 有没有一种方法可以保留这些字符?

Thanks, Simon 谢谢西蒙

I came across this issue recently when trying to import into mysql. 我最近在尝试导入mysql时遇到了这个问题。

There are a couple of ways round it, but you are best to create your own delimiters then save it as standard text. 有几种解决方法,但是最好创建自己的定界符,然后将其另存为标准文本。

Depending on how many columns there are - you might want to do this a number of ways, but one way or another at the end of your data do A1 & "," & B1 & "," etc - or you could use the iterative functions to make it do this for you by dragging down. 取决于有多少列-您可能想通过多种方式来执行此操作,但是在数据末尾使用A1&“,”&B1&“等等”进行另一种方式,或者您可以使用迭代方式功能,使其向下拖动即可为您完成此操作。

Once you have this string - put an equals at the front and it should concatenate the lot. 一旦有了这个字符串,在前面放一个等于号,它应该将很多串联起来。

You can then move all rows to a new sheet and save as text. 然后,您可以将所有行移动到新工作表并另存为文本。 You'll have a pure csv, without any of the nasty unicode problems that often occur. 您将拥有一个纯csv,而不会遇到任何常见的讨厌的unicode问题。

Hope that helps 希望能有所帮助

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM