I have following lines with ^M (return carriage). I want to remove ^M+proceeding line. You can notice there is a new line after each ^M, which is not desired. I purpose is to remove control character and make one line CSV.
'1.0';'';'';'';'Mon Jul 04 00:00:00 CEST 2016';'To cash Pls Acc 4142^M
To cash Pls Acc 4142';'To cash Pls Acc 4142^M
Money';'236159';'236159';'-2000.0';'';'2000.0'
I tried following but didn't work. NOTE: ^M = CONTROL v + CONTRL m
cat file.csv | sed 's/[\^M\n]//g' > new_file.csv
above lines removed ^M but the line is still broken with new line.
expected output
'1.0';'';'';'';'Mon Jul 04 00:00:00 CEST 2016';'To cash Pls Acc 4142To cash Pls Acc 4142';'To cash Pls Acc 4142 Money';'236159';'236159';'-2000.0';'';'2000.0'
dos2unix
for example. – Kusalananda Jan 02 '17 at 11:34