Replacing whitespace with sed in a CSV (to use w/ postgres copy command)
- by Wells
I iterate through a collection of CSV files in bash, running:
iconv --from-code=ISO-8859-1 --to-code=UTF-8 ${FILE} | \
sed -e 's/\"//g' | \
sed -e 's/, /,/g' \
> ${FILE}.utf8
Running iconv to fix UTF-8 characters, then the first sed call removes the double quote characters, and the final sed call is supposed to remove leading and…