Last active
March 10, 2017 03:49
-
-
Save gonzalo-bulnes/89906945958eb6ecae7d9b837161ec03 to your computer and use it in GitHub Desktop.
Convert a CSV file with Windows (or broken) encoding to Unix encoding (including end of line characters).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Convert input with Windows (or broken) encoding to Unix encoding (including end of line characters). | |
# | |
# Usage: | |
# | |
# cat windows.csv | ./convert.sh > unix.csv | |
# Convert encoding to UTF-8 | |
iconv -f iso-8859-1 -t utf-8 < /dev/stdin | \ | |
# Remove the broken line endings (or the unnecessary carriage returns) | |
tr -d "\r" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment