shell用逗号替换cr \ lf [英] shell replace cr\lf by comma
本文介绍了shell用逗号替换cr \ lf的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有input.txt
I have input.txt
1
2
3
4
5
我需要获取此类output.txt
I need to get such output.txt
1,2,3,4,5
该怎么做?
推荐答案
尝试一下:
tr '\n' ',' < input.txt > output.txt
这篇关于shell用逗号替换cr \ lf的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文