Skip to content

Instantly share code, notes, and snippets.

@mautematico
Last active August 7, 2023 16:38
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 mautematico/5567fb3f1cad166dbc82 to your computer and use it in GitHub Desktop.
Save mautematico/5567fb3f1cad166dbc82 to your computer and use it in GitHub Desktop.
#!/bin/bash
cat posts.json | jq -c -M '.[]' | sed 's/\\"/\\\\"/g' | \
while read single_post;
do
post_id=$(echo $single_post | jq '.ID');
echo $single_post > post/$post_id.json;
done
echo "done"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment