简体   繁体   English

如何将分号分隔的文件转换为 csv

[英]How to Convert semicolon delimited file to csv

How to change delimiter semicolon to comma of a file in google sheets or other way?如何在谷歌表格或其他方式中将分隔符分号更改为文件的逗号? I have already tried text to column feature but my file is too large around 10 MB so it doesn't work.我已经尝试过文本到列功能,但我的文件太大了,大约 10 MB,所以它不起作用。

I have been through that path quite a few times, since business logic likes to use Excel, and software likes CSV.我已经走过这条路好几次了,因为业务逻辑喜欢使用 Excel,而软件喜欢 CSV。

Excel, and probably Google Sheets etc, are a pain to use for CSV. Excel,可能还有谷歌表格等,对于 CSV 来说使用起来很痛苦。 Especially Excel because it tries to be "friendly" for you, so it typically exports with separators determined by the Windows Locale (ex: ";" or "," ) - and excel usually shifts between quotes and no quotes.特别是 Excel 因为它试图对您“友好”,因此它通常使用由 Windows 语言环境确定的分隔符(例如:“;”或“,”)导出 - 并且 ZBF57C906FA7D2BB66D07372E41585D9 引号之间通常会转换。

If you HAVE the text file, and wish to IMPORT into excel, find the combination of separators that suits your language variant, using a test file.如果您有文本文件,并希望导入 excel,请使用测试文件找到适合您的语言变体的分隔符组合。 To convert the big text file, a tool like AWK is simple and awesome.要转换大文本文件,像 AWK 这样的工具既简单又棒。

To EXPORT from Excel, I would again just go with whatever Excel wants to do, then adapt the file after using AWK or similar.要从 Excel 导出,我将再次使用 go 与 Excel 想要做的任何事情,然后在使用 Z015DBC48BAA9A68 之后调整文件。 Easier for me than trying to find settings for separator and quoting.对我来说比尝试查找分隔符和引用的设置更容易。

There is an article here that I find helpful.这里有一篇文章,我觉得很有帮助。

PS: I should mention that in most of European region, CSV IS semicolon by default. PS:我应该提一下,在大多数欧洲地区, CSV默认是分号。

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

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