Main Content

Conversion of c/r line ends to l/f line ends

Archive - Originally posted on "The Horse's Mouth" - 2008-06-28 11:52:28 - Graham Ellis

Situation - Excel saved file that I want to read into a Lua program I'm writing on Linux. End of line characters on the Excel file are [cr], and Linux used [lf]. Quick solution - sed

sed 's/\x0d/\x0a/g' stationusage.txt > st2.txt

Literally "substitute globally every hex 0D with a hex 0A"