Update file Run.sh

This commit is contained in:
TRBC Developer committed 2024-01-24 13:24:28 +00:00
1 parent ae55276298
commit 03b5b5d7df
1 file changed
+16 -17
+16 -17
View File
@@ -64,27 +64,26 @@ do
echo "Copying file to the folder called Addresses" echo "Copying file to the folder called Addresses"
fi fi
done done
echo "All done sorting!" You can find all the Files in $OUTPUTFOLDER!" echo "All done sorting! You can find all the Files in $OUTPUTFOLDER!"
echo echo
# echo echo
# read -r -p "Do you want to continue? [Y/n]" response read -r -p "Do you want to continue? [Y/n]" response
# response=${response,,} # tolower response=${response,,} # tolower
# if [[ $response =~ ^(y| ) ]] || [[ -z $response ]]; then if [[ $response =~ ^(y| ) ]] || [[ -z $response ]]; then
cd $PDFDIR
cd $PDFDIR for FILENAME in $PDFDIR/*
for FILENAME in $PDFDIR/* do
do echo $FILENAME
echo $FILENAME
#The next Line assigns the number of pages to the value LOCATION to be used for were the file goes #The next Line assigns the number of pages to the value LOCATION to be used for were the file goes
LOCATION=$(pdfinfo "$FILENAME" | grep Pages: | awk '{print $2}') LOCATION=$(pdfinfo "$FILENAME" | grep Pages: | awk '{print $2}')
#Test if the file exists and if it does move it to Temp.pdf to be merged back to its original location. #Test if the file exists and if it does move it to Temp.pdf to be merged back to its original location.
if test -f $OUTPUTFOLDER/Statement-Pages-$LOCATION.pdf if test -f $OUTPUTFOLDER/Statement-Pages-$LOCATION.pdf
then then
mv $OUTPUTFOLDER/Statement-Pages-$LOCATION.pdf $OUTPUTFOLDER/temp.pdf mv $OUTPUTFOLDER/Statement-Pages-$LOCATION.pdf $OUTPUTFOLDER/temp.pdf
pdfunite "$FILENAME" $OUTPUTFOLDER/temp.pdf $OUTPUTFOLDER/Statement-Pages-$LOCATION.pdf pdfunite "$FILENAME" $OUTPUTFOLDER/temp.pdf $OUTPUTFOLDER/Statement-Pages-$LOCATION.pdf
else else
#IF the file doesn't exist create the file with the merge. #IF the file doesn't exist create the file with the merge.
pdfunite "$FILENAME" $OUTPUTFOLDER/Statement-Pages-$LOCATION.pdf pdfunite "$FILENAME" $OUTPUTFOLDER/Statement-Pages-$LOCATION.pdf
fi fi
done done
echo echo