Last active
July 10, 2019 16:14
-
-
Save jordanholliday/bfccbff192c9ed77e9933e35621b590d to your computer and use it in GitHub Desktop.
Cat text file to json
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
$ brew install jq | |
$ var=$(cat filename.txt) | |
$ jq -n --arg v "$var" '{"foo": $v}' > filename.json |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment