Last active
December 27, 2015 15:59
-
-
Save gpr/7352071 to your computer and use it in GitHub Desktop.
How to get a specific field value with csvkit
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
#!/bin/bash | |
# | |
# csvget -- use csvkit too get a specific field value | |
# | |
# Usage: csvget <field_name> <line_number> | |
# get the field <field_name> value at the <line_number>th line | |
FieldName=${1:?} | |
N=${2:?} | |
csvcut -c "$FieldName" | sed -n ${N}p |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment