How do I export an Excel file with Chinese characters to a CSV?

后端 未结 6 1687
慢半拍i
慢半拍i 2021-02-05 11:13

I having a Excel document with a data table containing Chinese characters. I am trying to export this Excel spreadsheet to a CSV file for importing into a MySQL database.

<
6条回答
  •  时光取名叫无心
    2021-02-05 11:25

    I have tried all above methods for my data but it does not quite work for my data (Simplified Chinese, over 700Mb. I have tried Windows Chinese and English system, English and Chinese excel. Windows excel seems not be able to save to utf8 even it claims to do so. I specify the uft8 csv in save as, but when i use the 'open sheet' to detect the encoding mehtods. it is not uft8,not GB* as well. Here is my final solution.

    (1) Download 'open sheet'.

    (2) Open it properly. You Ccan scroll the encoding method until you see the Chinese character displayed in the preview windows.

    (3) Save it as utf-8(if you want utf-8).

    PS:You need to figure out the default encoding in your system. As far as I know, Ubuntu deals with UTF8 fine. But the windows default Simplied Chinese is start with GB**.Even if you encode it as utf8, still, you might open it cocrrectly as well. In my case, r could not open my utf-8 csv, but can open the GB* encoding.

    This methods work well even your file is very large. Some other work around is google sheet(but the file size can be limited). Notepad++ also works for smaller file.

    There is a way to detect the encoding methods by opening your file and scroll through the encoding methods until you see the Chinese displayed correctly.

提交回复
热议问题