I have a problem when I try to remove ^M from a csv
When I type vim or vi file.csv, I get
A, TK,2015-04-06,14.4^M,14.7,10.0,0.0,54.0^M,13.3^M,135.0^M,33.8
B, NV,2015-04-06,14.4^M,14.7,5.4,0.0,47.0^M,14.8^M,97.0^M,31.3
I have tried with
tr -d '^M' < file.csv > file2.csv
But it doesn't remove, also with sed.
You could use dos2unix
command which is provided to do that.
Using GNU/sed just for fun :
sed -i -e "s/\r//g" file
Using tr
:
tr -d '\r' <file1 >file2
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