[PLUG] Translating ^M to \n [WORKING]

Rich Shepard rshepard at appl-ecosys.com
Tue Aug 13 17:46:55 UTC 2019


On Tue, 13 Aug 2019, Robert Citek wrote:

> Sounds like you used Emacs to do the equivalent of this:
>
> < hatchery_returns-2019-08-12.csv \
> tr -s '\r\n' '\n' |
> sed -e 's/, /,/g;s/,$//' \
>> hatchery_returns-2019-08-12.cleaned.csv
>
> Is that right?

Robert,

Nope.

On the command line I ran:

dd if=<infile> bs=1 | tr '\r' '\n' > <outfile>

Then I put the outfile in an emacs buffer. No space at the beginning of the
file. Then I cleaned it by removing extraneous spaces and removing the
terminal comma when there were values for the last field in the line.

Now I have usable files I can search for information I want.

Thanks,

Rich



More information about the PLUG mailing list