[PLUG] Translating ^M to \n

Paul Heinlein heinlein at madboa.com
Mon Aug 12 22:14:55 UTC 2019


On Mon, 12 Aug 2019, Rich Shepard wrote:

> On Mon, 12 Aug 2019, Paul Heinlein wrote:
>
>>  tr -d '\r' < infile.csv > outfile.csv
>
> Thanks, Paul. I didn't know if tr would recognize ^M as \r so I used
> 	cat <infile> | tr "^M" "\n" and that changed it to the Mac format, 
> rather than the UNIX format, for some reason

My original recipe above merely deletes carriage returns; it leaves 
newlines intact.

-- 
Paul Heinlein
heinlein at madboa.com
45°38' N, 122°6' W


More information about the PLUG mailing list