Created
July 31, 2014 13:37
-
-
Save leonidlm/02633b872844a79e973c to your computer and use it in GitHub Desktop.
Concatenate json files by date (which appears as part of the file name)
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
# | |
# grouping files of 2014-04-12-01.json format into one json per mday (2014-04-12) | |
# | |
distinct_dates=$(ls -l | awk '{print $9}' | awk -F "-" '{count[$1"-"$2"-"$3]++}END{for(j in count) print j}') | |
for i in $distinct_dates | |
do | |
echo "Grouping for $i month" | |
cat $i-*.json* > /tmp/$i.json | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment