合并两个文件时如何避免换行符号?
How to avoid break line symbol when merging two files?
- tell me about yourself^M
20 - bye for now
21 - tell me about you^M
22 - catch you later
23 - about yourself^M
我使用以下命令合并两个文本文件:
cat 1.txt >> 2.txt
但是合并后的文件引入了很多^M。如何作废?我正在研究 Mac Pro。
^M为回车return字符,八进制015,用tr
'
删除
cat 1.txt | tr -d '5' >> 2.txt
- tell me about yourself^M
20 - bye for now
21 - tell me about you^M
22 - catch you later
23 - about yourself^M
我使用以下命令合并两个文本文件:
cat 1.txt >> 2.txt
但是合并后的文件引入了很多^M。如何作废?我正在研究 Mac Pro。
^M为回车return字符,八进制015,用tr
'
cat 1.txt | tr -d '5' >> 2.txt