带有阿拉伯字符的CSV文件在Excel中显示为符号 [英] CSV file with Arabic characters is displayed as symbols in Excel
问题描述
我正在使用python从twitter提取阿拉伯文推文并将其保存为CSV文件,但是当我在excel中打开保存的文件时,阿拉伯文显示为符号.但是,在python和记事本或word中,它看起来不错.我可以知道问题出在哪里吗?
I am using python to extract Arabic tweets from twitter and save it as a CSV file, but when I open the saved file in excel the Arabic language displays as symbols. However, inside python and notepad or word, it looks good. May I know where is the problem?
推荐答案
当打开包含阿拉伯字符的CSV文件时,Microsoft Excel经常会遇到这个问题.请尝试以下在我在Windows和MacOS上的最新版本的Microsoft Excel上测试过的变通办法:
This is a problem I face frequently with Microsoft Excel when opening CSV files that contain Arabic characters. Try the following workaround that I tested on latest versions of Microsoft Excel on both Windows and MacOS:
-
在空白工作簿上
-
打开Excel
在数据标签中,点击来自文本按钮(如果没有) 激活,请确保选择了一个空单元格)
Within the Data tab, click on From Text button (if not activated, make sure an empty cell is selected)
浏览并选择CSV文件
在文本导入向导"中,将 File_origin 更改为" Unicode(UTF-8)"
In the Text Import Wizard, change the File_origin to "Unicode (UTF-8)"
下一步,从分隔符中,选择文件中使用的分隔符,例如逗号
Go next and from the Delimiters, select the delimiter used in your file e.g. comma
完成,然后选择导入数据的位置
Finish and select where to import the data
阿拉伯字符应正确显示.
The Arabic characters should show correctly.
这篇关于带有阿拉伯字符的CSV文件在Excel中显示为符号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!