0
- tell me about yourself^M
  20 - bye for now
  21 - tell me about you^M
  22 - catch you later
  23 - about yourself^M

I use the following command to merge two text files:

cat 1.txt >> 2.txt

But the merged file introduced lots of ^M. How to void that? I am working on Mac Pro.

marlon
  • 6,029
  • 8
  • 42
  • 76

1 Answers1

0

The ^M is a carriage return character, octal 015. Delete it with tr'

cat 1.txt | tr -d '\015' >> 2.txt
Ken Jackson
  • 479
  • 4
  • 5