-
-
Save joyoyoyoyoyo/4aca30647f73360587b494f0553c20b5 to your computer and use it in GitHub Desktop.
CSV parsing in Awk
This file contains 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
#Requires GNU awk 4+, but eliminates the need for a specialized CSV library to handle quoted fields that contain delimiters. | |
#http://www.gnu.org/software/gawk/manual/html_node/Splitting-By-Content.html | |
#http://stackoverflow.com/a/17287068/75386 | |
gawk -vFPAT='[^,]*|"[^"]*"' '{print $1,$2,$3}' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment