Skip to content

Instantly share code, notes, and snippets.

@fungiboletus
Last active November 4, 2017 09:52
Show Gist options
  • Save fungiboletus/006eae539739a5bb3542fec285a2c87d to your computer and use it in GitHub Desktop.
Save fungiboletus/006eae539739a5bb3542fec285a2c87d to your computer and use it in GitHub Desktop.
CouchDB _all_docs to JSON Lines
cat input_file.json | sed 's/^M$//' | tail -n "+2" | head -n "-1" | sed 's/},*\r*$//' | sed 's/^.*doc"://' | grep -v '^{"_id":"_design/' > output_file.json
# I like useless cats, it looks cleaner
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment