Converting line endings… gotta love it.
I received a text file today that I needed to parse it to automate building several hundred WordPress accounts, more on that at another time, and the file had DOS line endings. I knew there had to be a way to correct this that did not require the installation of any new software or libraries.
Heck, I’m on a *nix based OS. How about “tr”
“tr” will translate characters for me, and it is available from the OSX command line.
Hmmm.. how about.
cat lots_o_authors.csv | tr -d "r" > new_lots_o_authors.csv
Cool, everything works now and I didn’t have to leave my terminal either, woo-hoo.