I am trying to remove a bunch of ^K from a file in linux for class but everything I have been trying is not working.
so I cat a file memo.txt and it has double spaced lines
I less the file and it has ^K after every line
I am trying to remove the ^K and output it into a new file
I have tried
cat memo.txt | tr -d "\n" > memo.new
cat memo.txt | tr -d "^K" > memo.new
and some other sed functions.
You might want to try something like this:
tr -d '\013' < memo.txt > memo.new
013
is the octal value for the character ^K
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With