Created
December 18, 2013 09:59
-
-
Save mazieres/8019876 to your computer and use it in GitHub Desktop.
clean Github archive files that don't have one entry per line.
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
#!/bin/bash | |
for f in `ls . | grep json.gz` | |
do | |
if [ `zcat $f | wc -l` == 0 ] ; then | |
gunzip $f | |
for unf in `ls *.json` | |
do | |
echo $unf | |
sed -i 's/}{/}\n{/g' $unf | |
gzip $unf | |
done | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment