Skip to content

Instantly share code, notes, and snippets.

@rahul286
Last active October 12, 2015 22:13
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save rahul286/213cb6dc83019aeb8858 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