Finished script comments and tweeks needed.

This commit is contained in:
btmccrea committed 2020-12-22 17:04:29 -05:00
1 parent 5252fc1932
commit b5f85b754f
1 file changed
+12 -11
Regular → Executable
+12 -11
View File
@@ -16,7 +16,7 @@ while :
do
echo -e "What is the output directory for the pdf's with missing addresses?"
#read OUTPUTFOLDER
OUTPUTFOLDER=/home/btmccrea/Documents/ouput
OUTPUTFOLDER=/home/btmccrea/Documents/output/
if [ -d $PDFDIR ]; then
break
else
@@ -24,18 +24,19 @@ do
fi
done
FILES=$(ls $PDFDIR)
touch "$OUTPUTFOLDER"Addresses.csv
echo "File, User, Address" > "$OUTPUTFOLDER"Addresses.csv
#FILES=$(ls $PDFDIR)
cd $PDFDIR
echo $FILES
for f in "$FILES"
#echo $FILES
#* represensts All files in the current directory
for f in *.pdf ;
do
pdftotext $f - | TEMPFILE
ADDRESS=$(awk 'NR == 14 {print ; exit}' TEMPFILE)
echo $ADDRESS
if [ -z $ADDRESS ]; then
cp $f to $OUTPUTFOLDER
fi
pdftotext "$f" temp
USER=$(sed -n '13p' temp)
ADDRESS1=$(sed -n '14p' temp)
ADDRESS2=$(sed -n '15p' temp)
echo "$f, $USER, '$ADDRESS1 $ADDRESS2'" >> "$OUTPUTFOLDER"Addresses.csv
done
exit