Created
September 12, 2017 05:50
-
-
Save vochicong/04e84e0c84fc8f972d1c7f3861f6998a to your computer and use it in GitHub Desktop.
jq to extract a json value from CSV
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
# Input: 901,1,187,7,1,[email protected],"{""u"":""name"",""limit_date"":""2017/09/18 23:59"",""token"":""b0kasdfuadf3jdadfubd"",""language"":""ja""}",9/12/17 9:01,NULL,NULL,NULL,9/11/17 15:59,9/11/17 16:00,NULL | |
# Output: b0kasdfuadf3jdadfubd | |
cat token_lists.csv | jq -R 'split(",") | .[8] | split("\"") | .[6]' | sed 's/"//g' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment