Skip to content

Instantly share code, notes, and snippets.

@gimntut
Last active August 29, 2015 14:24
Show Gist options
  • Save gimntut/884f930361dbab0f2aab to your computer and use it in GitHub Desktop.
Save gimntut/884f930361dbab0f2aab to your computer and use it in GitHub Desktop.
echo "[" > begin.txt
echo "{}]" > end.txt
sed -rn "s=\"=\\\"=p" aneks.sql >aneks2.txt
sed -rn "s=.*\`anek\`.*\(([0-9]+), ([0-9]+), '(.*)'.*={\"id\":\"\1\", \"category\":\"\2\", \"text\":\"\3\", \"collections\":[{\"id\":\"anekdot\"}]},=p" aneks2.txt > 0.txt
cat begin.txt 0.txt end.txt >anekdots.json
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment