Skip to content

Instantly share code, notes, and snippets.

@mazieres
Created December 18, 2013 09:59
Show Gist options
  • Save mazieres/8019876 to your computer and use it in GitHub Desktop.
Save mazieres/8019876 to your computer and use it in GitHub Desktop.
clean Github archive files that don't have one entry per line.
#!/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