Last active
August 29, 2015 14:19
-
-
Save giulioungaretti/50cc26320bed0b6b63cc to your computer and use it in GitHub Desktop.
sort
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gzcat 2015-02-01.json.log.gz | jq -c '[.timestamp, .]' >> json.log && sort -t "," -k1 json.log | cut -d "," -f 2- | cut -d "]" -f 1 >> clean.json |
tudborg
commented
Apr 17, 2015
#!/bin/bash
INFILE="data.jsonline"
OUTFILE="sorted.jsonline"
while read line; do
ts="$(echo "$line" | jq -r '.t')"
echo "$ts $line"
done < <(cat "$INFILE") | sort -k1 - | cut -d " " -f 2- > "$OUTFILE"
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment