Last active
November 29, 2017 14:16
-
-
Save kmatt/a15467a3904627050ed5 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