csvquote: smart and simple CSV processing on the command line

在处理csv文本发现awk不能直接处理引号内包括逗号的数据,比如:

field1,"field2, has a comma in it","field 3 has a ""Quoted String"" in it"

这是可以使用csvquote工具来处理了,此工具需要源代码安装,代码地址:https://github.com/dbro/csvquote

Are you looking for a way to process CSV data with standard UNIX shell commands?

Are you running into problems with embedded commas and newlines that mess everything up?

Do you wish there was some way to add some CSV intelligence to these UNIX tools?

awk, sed
cut, join
head, tail
sort, uniq
wc, split
This program can be used at the start and end of a text processing pipeline so that regular unix command line tools can properly handle CSV data that contain commas and newlines inside quoted data fields.


已发布

分类

来自

标签:

评论

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注