Skip to content

Instantly share code, notes, and snippets.

@landsurveyorsunited
Forked from rahul286/ning-json-fix.sh
Created October 12, 2015 22:13
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save landsurveyorsunited/536b276ec1ff96c55d67 to your computer and use it in GitHub Desktop.
Save landsurveyorsunited/536b276ec1ff96c55d67 to your computer and use it in GitHub Desktop.
Fixing invalid json files created by Ning Archiver tool
## MAC OSX users, please note that following codes won't work with BSD based sed implementation.
## You can get GNU Mac- `brew install gnu-sed --default-names`
sed -i -e '1s/^.//' ning*
sed -i -e '$s/.$//' ning*
sed -i -e 's/}{/},{/g' ning*
sed -i -e 's/}]{/},{/g' ning*
## extra: to verify if files are valid JSON filesmm run jsonlint
## To install `npm install jsonlint -g`
jsonlint -q *.json
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment