Last active
December 18, 2015 09:16
-
-
Save joostrijneveld/02c5d4ee49feeffd132e to your computer and use it in GitHub Desktop.
Splits a set of PDFs into two folders for TAs to check
This file contains hidden or 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
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