从 CSV 中删除 (CR) [英] Remove (CR) from CSV
本文介绍了从 CSV 中删除
(CR)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在 OSX 上,我需要删除行尾 CR (
) 字符(在 cat -v
^M>) 来自我的 CSV 文件:
On OSX I need to remove line-ending CR (
) characters (represented as ^M
in the output from cat -v
) from my CSV file:
$ cat -v myitems.csv
输出:
strPicture,strEmail^M
image1xl.jpg,me@example.com^M
我用 sed 和 perl 尝试了很多选项,但没有任何效果.
I have tried lots of options with sed and perl but nothing works.
有什么想法吗?
推荐答案
试试这个,它会解决你的问题.
try this, it will fix your issue.
dos2unix myitems.csv myitems.csv
这篇关于从 CSV 中删除 (CR)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文