简体   繁体   English

Bash从值创建CSV

[英]Bash creating csv from values

I'm trying to create a csv in my bash script from some values I'm getting from another non-csv file. 我正在尝试从另一个非csv文件获取的一些值在bash脚本中创建csv。 The problem I see is that the values have commas(,) in them. 我看到的问题是值中包含逗号(,)。

The csv file wrong because of that (the values with commas in them are 2 or more different values now) Is there any way to get rid of that problem or any other way to build a csv in a bash script. 因此,csv文件错误(现在带有逗号的值是2个或更多不同的值)是否有任何方法可以解决该问题,也可以通过其他任何方法在bash脚本中构建csv。 I can create any other files too, it just needs to be compatible with standard sql import. 我也可以创建任何其他文件,只需要与标准sql导入兼容即可。

Thanks 谢谢

I now added quotation marks before and after every value and it works great. 现在,我在每个值之前和之后添加了引号,效果很好。 The csv looks like it should. CSV看起来应该是这样。

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

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