Skip to content

Instantly share code, notes, and snippets.

@blahah
Last active April 9, 2017 15:18
Show Gist options
  • Save blahah/908dc28d52a3b064a17c599ae31da321 to your computer and use it in GitHub Desktop.
Save blahah/908dc28d52a3b064a17c599ae31da321 to your computer and use it in GitHub Desktop.
move elife json into nested directories based on ID
for json in $(ls *.json); do
splitdir=$(echo $json | sed -e 's/elife-\([0-9]\{5\}\)-v[0-9]\.json/\1/' -e 's/\(.\)/\1\//g')
echo moving $json to $splitdir
mkdir -p $splitdir
mv $json $splitdir/
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment