Skip to content

Instantly share code, notes, and snippets.

@joostrijneveld
Last active December 18, 2015 09:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joostrijneveld/02c5d4ee49feeffd132e to your computer and use it in GitHub Desktop.
Save joostrijneveld/02c5d4ee49feeffd132e to your computer and use it in GitHub Desktop.
Splits a set of PDFs into two folders for TAs to check
TAS=( NAME1 NAME2 )
REST=rest
for ta in ${TAS[@]}; do
mkdir -p $ta;
done
mkdir -p $REST
for f in pdfs/*.pdf
do
nr=`echo $f | sed -e 's/^[^_]*_//' | cut -c 1-8`;
for ta in ${TAS[@]}; do
if grep -q $nr ${ta}.csv; then
mv "$f" $ta;
fi
done
done
for f in pdfs/*.pdf
do
mv "$f" $REST;
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment