Skip to navigation

Replace DOS line feeds (CRLF line terminators) using sed

A sed command stumbled on the fact that a text file came from Windows.

file filename.csv

gave

ASCII text, with CRLF line terminators

To fix it:

sed -i 's/^M//' filename.csv

Where the “^M” is input by pressing Ctrl-V then ENTER.
Credits.

Comments are closed.