逗号分隔值(CSV)文件包含纯文本格式的表格中的数据。尽管CSV文件可以用文本编辑器来打开,但最好是用电子表格程序来查看里面的数据。因为CSV文件采用了特殊格式,所以确保正确显示的唯一方法是按专门的流程来导入它们。这篇文章将教你如何正确地把CSV文件导入Microsoft Excel、Google Sheets以及OpenOffice Calc。
步骤
方法 1 的 3:
Microsoft Excel
-
{"smallUrl":"https:\/\/www.zenmeban.com\/images_en\/thumb\/a\/ab\/Open-CSV-Files-Step-1-Version-3.jpg\/v4-460px-Open-CSV-Files-Step-1-Version-3.jpg","bigUrl":"https:\/\/www.zenmeban.com\/images\/thumb\/a\/ab\/Open-CSV-Files-Step-1-Version-3.jpg\/v4-728px-Open-CSV-Files-Step-1-Version-3.jpg","smallWidth":460,"smallHeight":345,"bigWidth":728,"bigHeight":546,"licensing":"<div class=\"mw-parser-output\"><\/div>"}
1
在电脑上打开Microsoft Excel。它位于你的Windows菜单(PC)或应用文件夹(Mac)里。
- 打开CSV文件的简单方法是在欢迎屏幕中点击打开,选择CSV文件,然后点击打开。但是,这样可能无法按预期显示CSV中的数据。这种方法可以正确打开CSV文件,并且不会丢失格式以及其他数据。
-
{"smallUrl":"https:\/\/www.zenmeban.com\/images_en\/thumb\/a\/aa\/Open-CSV-Files-Step-2-Version-3.jpg\/v4-460px-Open-CSV-Files-Step-2-Version-3.jpg","bigUrl":"https:\/\/www.zenmeban.com\/images\/thumb\/a\/aa\/Open-CSV-Files-Step-2-Version-3.jpg\/v4-728px-Open-CSV-Files-Step-2-Version-3.jpg","smallWidth":460,"smallHeight":345,"bigWidth":728,"bigHeight":546,"licensing":"<div class=\"mw-parser-output\"><\/div>"}
2
点击中间部分的空白工作簿。
-
{"smallUrl":"https:\/\/www.zenmeban.com\/images_en\/thumb\/4\/47\/Open-CSV-Files-Step-3-Version-3.jpg\/v4-460px-Open-CSV-Files-Step-3-Version-3.jpg","bigUrl":"https:\/\/www.zenmeban.com\/images\/thumb\/4\/47\/Open-CSV-Files-Step-3-Version-3.jpg\/v4-728px-Open-CSV-Files-Step-3-Version-3.jpg","smallWidth":460,"smallHeight":345,"bigWidth":728,"bigHeight":546,"licensing":"<div class=\"mw-parser-output\"><\/div>"}
3
点击Excel顶部的数据选项卡。
-
{"smallUrl":"https:\/\/www.zenmeban.com\/images_en\/thumb\/5\/5a\/Open-CSV-Files-Step-4-Version-3.jpg\/v4-460px-Open-CSV-Files-Step-4-Version-3.jpg","bigUrl":"https:\/\/www.zenmeban.com\/images\/thumb\/5\/5a\/Open-CSV-Files-Step-4-Version-3.jpg\/v4-728px-Open-CSV-Files-Step-4-Version-3.jpg","smallWidth":460,"smallHeight":345,"bigWidth":728,"bigHeight":546,"licensing":"<div class=\"mw-parser-output\"><\/div>"}
4
点击工具栏左侧的从文本。这样会打开“导入”窗口。
-
{"smallUrl":"https:\/\/www.zenmeban.com\/images_en\/thumb\/3\/37\/Open-CSV-Files-Step-5-Version-3.jpg\/v4-460px-Open-CSV-Files-Step-5-Version-3.jpg","bigUrl":"https:\/\/www.zenmeban.com\/images\/thumb\/3\/37\/Open-CSV-Files-Step-5-Version-3.jpg\/v4-728px-Open-CSV-Files-Step-5-Version-3.jpg","smallWidth":460,"smallHeight":346,"bigWidth":728,"bigHeight":547,"licensing":"<div class=\"mw-parser-output\"><\/div>"}
5
选择CSV文件并点击导入。这样会启动“文本导入向导”,从而让你能自定义如何把文件导入Excel中。
-
{"smallUrl":"https:\/\/www.zenmeban.com\/images_en\/thumb\/f\/f0\/Open-CSV-Files-Step-6-Version-3.jpg\/v4-460px-Open-CSV-Files-Step-6-Version-3.jpg","bigUrl":"https:\/\/www.zenmeban.com\/images\/thumb\/f\/f0\/Open-CSV-Files-Step-6-Version-3.jpg\/v4-728px-Open-CSV-Files-Step-6-Version-3.jpg","smallWidth":460,"smallHeight":346,"bigWidth":728,"bigHeight":547,"licensing":"<div class=\"mw-parser-output\"><\/div>"}
6
选择分隔符。这是窗口左上角的第一个选项。
-
{"smallUrl":"https:\/\/www.zenmeban.com\/images_en\/thumb\/e\/e9\/Open-CSV-Files-Step-7-Version-3.jpg\/v4-460px-Open-CSV-Files-Step-7-Version-3.jpg","bigUrl":"https:\/\/www.zenmeban.com\/images\/thumb\/e\/e9\/Open-CSV-Files-Step-7-Version-3.jpg\/v4-728px-Open-CSV-Files-Step-7-Version-3.jpg","smallWidth":460,"smallHeight":346,"bigWidth":728,"bigHeight":547,"licensing":"<div class=\"mw-parser-output\"><\/div>"}
7
点击下一步继续。
-
{"smallUrl":"https:\/\/www.zenmeban.com\/images_en\/thumb\/8\/85\/Open-CSV-Files-Step-8-Version-3.jpg\/v4-460px-Open-CSV-Files-Step-8-Version-3.jpg","bigUrl":"https:\/\/www.zenmeban.com\/images\/thumb\/8\/85\/Open-CSV-Files-Step-8-Version-3.jpg\/v4-728px-Open-CSV-Files-Step-8-Version-3.jpg","smallWidth":460,"smallHeight":344,"bigWidth":728,"bigHeight":545,"licensing":"<div class=\"mw-parser-output\"><\/div>"}
8
选中“逗号”旁边的复选框。如果在“分隔符”部分中选中了任何其他项,那就取消勾选它们。
-
{"smallUrl":"https:\/\/www.zenmeban.com\/images_en\/thumb\/7\/72\/Open-CSV-Files-Step-9-Version-3.jpg\/v4-460px-Open-CSV-Files-Step-9-Version-3.jpg","bigUrl":"https:\/\/www.zenmeban.com\/images\/thumb\/7\/72\/Open-CSV-Files-Step-9-Version-3.jpg\/v4-728px-Open-CSV-Files-Step-9-Version-3.jpg","smallWidth":460,"smallHeight":344,"bigWidth":728,"bigHeight":545,"licensing":"<div class=\"mw-parser-output\"><\/div>"}
9
点击下一步继续。
-
{"smallUrl":"https:\/\/www.zenmeban.com\/images_en\/thumb\/0\/0f\/Open-CSV-Files-Step-10-Version-3.jpg\/v4-460px-Open-CSV-Files-Step-10-Version-3.jpg","bigUrl":"https:\/\/www.zenmeban.com\/images\/thumb\/0\/0f\/Open-CSV-Files-Step-10-Version-3.jpg\/v4-728px-Open-CSV-Files-Step-10-Version-3.jpg","smallWidth":460,"smallHeight":345,"bigWidth":728,"bigHeight":546,"licensing":"<div class=\"mw-parser-output\"><\/div>"}
10
选择预览中的所有列。方法如下:
- 点击第一列的标题把它选中。
- 如果最后一列没有显示出来,那就用滚动条拉到最后。
- 按住Shift键并点击最后一列的标题。现在,所有的列变都已选中了。
-
{"smallUrl":"https:\/\/www.zenmeban.com\/images_en\/thumb\/c\/c8\/Open-CSV-Files-Step-11-Version-3.jpg\/v4-460px-Open-CSV-Files-Step-11-Version-3.jpg","bigUrl":"https:\/\/www.zenmeban.com\/images\/thumb\/c\/c8\/Open-CSV-Files-Step-11-Version-3.jpg\/v4-728px-Open-CSV-Files-Step-11-Version-3.jpg","smallWidth":460,"smallHeight":345,"bigWidth":728,"bigHeight":546,"licensing":"<div class=\"mw-parser-output\"><\/div>"}
11
选择左上角的文本作为列数据格式。
-
{"smallUrl":"https:\/\/www.zenmeban.com\/images_en\/thumb\/f\/f0\/Open-CSV-Files-Step-12-Version-3.jpg\/v4-460px-Open-CSV-Files-Step-12-Version-3.jpg","bigUrl":"https:\/\/www.zenmeban.com\/images\/thumb\/f\/f0\/Open-CSV-Files-Step-12-Version-3.jpg\/v4-728px-Open-CSV-Files-Step-12-Version-3.jpg","smallWidth":460,"smallHeight":345,"bigWidth":728,"bigHeight":546,"licensing":"<div class=\"mw-parser-output\"><\/div>"}
12
点击完成。现在,你就会看到CSV文件的内容,而且格式没有发生任何意外变动。
方法 2 的 3:
Google Sheets
-
{"smallUrl":"https:\/\/www.zenmeban.com\/images_en\/thumb\/4\/43\/Open-CSV-Files-Step-13-Version-2.jpg\/v4-460px-Open-CSV-Files-Step-13-Version-2.jpg","bigUrl":"https:\/\/www.zenmeban.com\/images\/thumb\/4\/43\/Open-CSV-Files-Step-13-Version-2.jpg\/v4-728px-Open-CSV-Files-Step-13-Version-2.jpg","smallWidth":460,"smallHeight":346,"bigWidth":728,"bigHeight":547,"licensing":"<div class=\"mw-parser-output\"><\/div>"}
1
前往 https://docs.google.com/spreadsheets 。如果你已经登录了Google帐户,这时就会显示Google Sheets——Google免费的用来替代Excel的免费应用。如果没有出现,那就按照屏幕说明立即登录。
- Google Sheets是免费的,但你得有Google帐户才能使用。如果你还没有Google帐户,那就点击创建帐户,按照屏幕提示立即创建一个。
-
{"smallUrl":"https:\/\/www.zenmeban.com\/images_en\/thumb\/a\/a2\/Open-CSV-Files-Step-14-Version-2.jpg\/v4-460px-Open-CSV-Files-Step-14-Version-2.jpg","bigUrl":"https:\/\/www.zenmeban.com\/images\/thumb\/a\/a2\/Open-CSV-Files-Step-14-Version-2.jpg\/v4-728px-Open-CSV-Files-Step-14-Version-2.jpg","smallWidth":460,"smallHeight":345,"bigWidth":728,"bigHeight":546,"licensing":"<div class=\"mw-parser-output\"><\/div>"}
2
点击+。它是页面左上角的四色加号。这样将创建一个空白的工作表文件。
-
{"smallUrl":"https:\/\/www.zenmeban.com\/images_en\/thumb\/1\/1f\/Open-CSV-Files-Step-15-Version-2.jpg\/v4-460px-Open-CSV-Files-Step-15-Version-2.jpg","bigUrl":"https:\/\/www.zenmeban.com\/images\/thumb\/1\/1f\/Open-CSV-Files-Step-15-Version-2.jpg\/v4-728px-Open-CSV-Files-Step-15-Version-2.jpg","smallWidth":460,"smallHeight":345,"bigWidth":728,"bigHeight":546,"licensing":"<div class=\"mw-parser-output\"><\/div>"}
3
点击工作表左上角的文件菜单。
-
{"smallUrl":"https:\/\/www.zenmeban.com\/images_en\/thumb\/2\/28\/Open-CSV-Files-Step-16-Version-2.jpg\/v4-460px-Open-CSV-Files-Step-16-Version-2.jpg","bigUrl":"https:\/\/www.zenmeban.com\/images\/thumb\/2\/28\/Open-CSV-Files-Step-16-Version-2.jpg\/v4-728px-Open-CSV-Files-Step-16-Version-2.jpg","smallWidth":460,"smallHeight":345,"bigWidth":728,"bigHeight":546,"licensing":"<div class=\"mw-parser-output\"><\/div>"}
4
点击导入。这时候会打开“导入文件”窗口。
-
{"smallUrl":"https:\/\/www.zenmeban.com\/images_en\/thumb\/0\/0d\/Open-CSV-Files-Step-17-Version-2.jpg\/v4-460px-Open-CSV-Files-Step-17-Version-2.jpg","bigUrl":"https:\/\/www.zenmeban.com\/images\/thumb\/0\/0d\/Open-CSV-Files-Step-17-Version-2.jpg\/v4-728px-Open-CSV-Files-Step-17-Version-2.jpg","smallWidth":460,"smallHeight":345,"bigWidth":728,"bigHeight":546,"licensing":"<div class=\"mw-parser-output\"><\/div>"}
5
点击上传选项卡。你要进入这个选项卡才能从电脑上传文件。
-
{"smallUrl":"https:\/\/www.zenmeban.com\/images_en\/thumb\/0\/07\/Open-CSV-Files-Step-18-Version-2.jpg\/v4-460px-Open-CSV-Files-Step-18-Version-2.jpg","bigUrl":"https:\/\/www.zenmeban.com\/images\/thumb\/0\/07\/Open-CSV-Files-Step-18-Version-2.jpg\/v4-728px-Open-CSV-Files-Step-18-Version-2.jpg","smallWidth":460,"smallHeight":345,"bigWidth":728,"bigHeight":546,"licensing":"<div class=\"mw-parser-output\"><\/div>"}
6
选择或拖动文件。把CSV文件拖到虚线框中就会开始上传,或者你也可以点击选择您设备上的文件,然后从电脑中选择文件。
- 如果选择文件后你在左下角看到一个蓝色的选择按钮,那就点击它继续。
-
{"smallUrl":"https:\/\/www.zenmeban.com\/images_en\/thumb\/d\/db\/Open-CSV-Files-Step-19.jpg\/v4-460px-Open-CSV-Files-Step-19.jpg","bigUrl":"https:\/\/www.zenmeban.com\/images\/thumb\/d\/db\/Open-CSV-Files-Step-19.jpg\/v4-728px-Open-CSV-Files-Step-19.jpg","smallWidth":460,"smallHeight":345,"bigWidth":728,"bigHeight":546,"licensing":"<div class=\"mw-parser-output\"><\/div>"}
7
在“导入文件”窗口中选择替换电子表格。如果已经选择,那就跳过这一步。
-
{"smallUrl":"https:\/\/www.zenmeban.com\/images_en\/thumb\/d\/d7\/Open-CSV-Files-Step-20.jpg\/v4-460px-Open-CSV-Files-Step-20.jpg","bigUrl":"https:\/\/www.zenmeban.com\/images\/thumb\/d\/d7\/Open-CSV-Files-Step-20.jpg\/v4-728px-Open-CSV-Files-Step-20.jpg","smallWidth":460,"smallHeight":345,"bigWidth":728,"bigHeight":546,"licensing":"<div class=\"mw-parser-output\"><\/div>"}
8
在“分隔符类型”下选择逗号。这样会告诉工作表用逗号作为分隔符,这一点对于CSV文件很重要。
-
{"smallUrl":"https:\/\/www.zenmeban.com\/images_en\/thumb\/0\/09\/Open-CSV-Files-Step-21.jpg\/v4-460px-Open-CSV-Files-Step-21.jpg","bigUrl":"https:\/\/www.zenmeban.com\/images\/thumb\/0\/09\/Open-CSV-Files-Step-21.jpg\/v4-728px-Open-CSV-Files-Step-21.jpg","smallWidth":460,"smallHeight":345,"bigWidth":728,"bigHeight":546,"licensing":"<div class=\"mw-parser-output\"><\/div>"}
9
在“将文字转换为数字、日期和公式”下选择否。这样可以防止工作表在导入过程中改变文件的内容。
-
{"smallUrl":"https:\/\/www.zenmeban.com\/images_en\/thumb\/3\/30\/Open-CSV-Files-Step-22.jpg\/v4-460px-Open-CSV-Files-Step-22.jpg","bigUrl":"https:\/\/www.zenmeban.com\/images\/thumb\/3\/30\/Open-CSV-Files-Step-22.jpg\/v4-728px-Open-CSV-Files-Step-22.jpg","smallWidth":460,"smallHeight":345,"bigWidth":728,"bigHeight":546,"licensing":"<div class=\"mw-parser-output\"><\/div>"}
10
点击绿色导入数据按钮。这样会将CSV按照原本的格式导入工作表。
方法 3 的 3:
OpenOffice Calc
-
{"smallUrl":"https:\/\/www.zenmeban.com\/images_en\/thumb\/c\/c6\/Open-CSV-Files-Step-23.jpg\/v4-460px-Open-CSV-Files-Step-23.jpg","bigUrl":"https:\/\/www.zenmeban.com\/images\/thumb\/c\/c6\/Open-CSV-Files-Step-23.jpg\/v4-728px-Open-CSV-Files-Step-23.jpg","smallWidth":460,"smallHeight":345,"bigWidth":728,"bigHeight":546,"licensing":"<div class=\"mw-parser-output\"><\/div>"}
1
从OpenOffice Calc下载OpenOffice。如果你没有Microsoft Office,并且喜欢在电脑上安装应用程序,而不习惯使用在线的Google Sheets,那么OpenOffice Calc就是不错的免费替代品。只要从下拉菜单中选择你的操作系统,点击下载,然后运行下载的安装程序就可以了。在这套软件中,CSV文件唯一会用到的应用程序是Calc,所以请记得选择这个程序。你也可以随意安装任何其他的软件。
-
{"smallUrl":"https:\/\/www.zenmeban.com\/images_en\/thumb\/3\/30\/Open-CSV-Files-Step-24.jpg\/v4-460px-Open-CSV-Files-Step-24.jpg","bigUrl":"https:\/\/www.zenmeban.com\/images\/thumb\/3\/30\/Open-CSV-Files-Step-24.jpg\/v4-728px-Open-CSV-Files-Step-24.jpg","smallWidth":460,"smallHeight":345,"bigWidth":728,"bigHeight":546,"licensing":"<div class=\"mw-parser-output\"><\/div>"}
2
打开OpenOffice Calc。安装好软件过后,你就会在Windows菜单(PC)或应用文件夹(Mac)中找到Calc。
-
{"smallUrl":"https:\/\/www.zenmeban.com\/images_en\/thumb\/5\/5d\/Open-CSV-Files-Step-25.jpg\/v4-460px-Open-CSV-Files-Step-25.jpg","bigUrl":"https:\/\/www.zenmeban.com\/images\/thumb\/5\/5d\/Open-CSV-Files-Step-25.jpg\/v4-728px-Open-CSV-Files-Step-25.jpg","smallWidth":460,"smallHeight":345,"bigWidth":728,"bigHeight":546,"licensing":"<div class=\"mw-parser-output\"><\/div>"}
3
点击文件菜单并选择打开。这个菜单位于左上角,点击后会打开一个窗口,你可以在里面浏览电脑上的文件。
-
{"smallUrl":"https:\/\/www.zenmeban.com\/images_en\/thumb\/7\/7e\/Open-CSV-Files-Step-26.jpg\/v4-460px-Open-CSV-Files-Step-26.jpg","bigUrl":"https:\/\/www.zenmeban.com\/images\/thumb\/7\/7e\/Open-CSV-Files-Step-26.jpg\/v4-728px-Open-CSV-Files-Step-26.jpg","smallWidth":460,"smallHeight":345,"bigWidth":728,"bigHeight":546,"licensing":"<div class=\"mw-parser-output\"><\/div>"}
4
在“文件类型”菜单中选择文本CSV。你可能必须向下滚动一点才会在列表中找到它。
-
{"smallUrl":"https:\/\/www.zenmeban.com\/images_en\/thumb\/f\/ff\/Open-CSV-Files-Step-27.jpg\/v4-460px-Open-CSV-Files-Step-27.jpg","bigUrl":"https:\/\/www.zenmeban.com\/images\/thumb\/f\/ff\/Open-CSV-Files-Step-27.jpg\/v4-728px-Open-CSV-Files-Step-27.jpg","smallWidth":460,"smallHeight":345,"bigWidth":728,"bigHeight":546,"licensing":"<div class=\"mw-parser-output\"><\/div>"}
5
选择CSV文件并点击打开。这样会打开“文本导入”屏幕。[1]
-
{"smallUrl":"https:\/\/www.zenmeban.com\/images_en\/thumb\/e\/e7\/Open-CSV-Files-Step-28.jpg\/v4-460px-Open-CSV-Files-Step-28.jpg","bigUrl":"https:\/\/www.zenmeban.com\/images\/thumb\/e\/e7\/Open-CSV-Files-Step-28.jpg\/v4-728px-Open-CSV-Files-Step-28.jpg","smallWidth":460,"smallHeight":345,"bigWidth":728,"bigHeight":546,"licensing":"<div class=\"mw-parser-output\"><\/div>"}
6
选择“分隔”单选按钮。它位于“分隔符选项”标题下方。
-
{"smallUrl":"https:\/\/www.zenmeban.com\/images_en\/thumb\/1\/16\/Open-CSV-Files-Step-29.jpg\/v4-460px-Open-CSV-Files-Step-29.jpg","bigUrl":"https:\/\/www.zenmeban.com\/images\/thumb\/1\/16\/Open-CSV-Files-Step-29.jpg\/v4-728px-Open-CSV-Files-Step-29.jpg","smallWidth":460,"smallHeight":345,"bigWidth":728,"bigHeight":546,"licensing":"<div class=\"mw-parser-output\"><\/div>"}
7
选中“逗号”复选框。这样就会告诉Calc在CSV文件中使用逗号来分隔各列。
-
{"smallUrl":"https:\/\/www.zenmeban.com\/images_en\/thumb\/8\/8c\/Open-CSV-Files-Step-30.jpg\/v4-460px-Open-CSV-Files-Step-30.jpg","bigUrl":"https:\/\/www.zenmeban.com\/images\/thumb\/8\/8c\/Open-CSV-Files-Step-30.jpg\/v4-728px-Open-CSV-Files-Step-30.jpg","smallWidth":460,"smallHeight":345,"bigWidth":728,"bigHeight":546,"licensing":"<div class=\"mw-parser-output\"><\/div>"}
8
点击确定。CSV文件的内容现在就会在Calc中正确显示。