Files
eoy-pdf-sortandmerge/Removing_Files.sh
T

69 lines
1.4 KiB
Bash
Executable File

#!/bin/bash
#Get the folder with the pdf documents in it.
while :
do
echo -e "What is the directory with the pdfs?"
#read PDFDIR
PDFDIR="/home/btmccrea/Downloads/pdfs"
if [ -d $PDFDIR ]
then
break
else
echo -e "Directory not found."
fi
done
#Get the folder for the output file.
while :
do
echo -e "What is the output directory for the pdf's with missing addresses?"
#read OUTPUTFOLDER
OUTPUTFOLDER="/home/btmccrea/Downloads/output/Final"
if [ -d $OUTPUTFOLDER ]
then
break
else
echo -e "Directory not found."
fi
done
#Get the folder with the csv
while :
do
echo -e "What path and file with?"
#read CSVFILE
if [ -f $CSVFILE ]
then
break
else
echo -e "File not found."
fi
done
#import list from csv
echo "Processing csv."
while IFS=$'\t' read -r FILE
do
echo "FILE $FILE"
# echo "user $USER"
# echo "match $MATCH"
# echo "${array[0]}"
# if [[ "$MATCH" == "Match-Mailable" ]]
# then
#
# echo -e "Processing file $FILE"lY
cp $PDFDIR/"$FILE" $OUTPUTFOLDER
# else
# echo "no match"
# fi
done < /home/btmccrea/Downloads/Smarty_Streets.csv
#FILE=$(cat /home/btmccrea/Downloads/Smarty_Streets.csv)
#echo $FILE
#IFS=$'\t'
#for f in Smarty_Streets.csv
#do
# echo "doing file $f"
# cp $PDFDIR/"$f" $OUTPUTFOLDER
#done
#cd to and then remove files