diff --git a/Sort_and_Merge_Files.sh b/Sort_and_Merge_Files.sh index b490083..848a14f 100755 --- a/Sort_and_Merge_Files.sh +++ b/Sort_and_Merge_Files.sh @@ -39,13 +39,13 @@ do #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}') #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 $OUTPUTFOLDERStatement-Pages-$LOCATION.pdf + if test -f $OUTPUTFOLDER/Statement-Pages-$LOCATION.pdf then - mv $OUTPUTFOLDERStatement-Pages-$LOCATION.pdf $OUTPUTFOLDERtemp.pdf - pdfunite "$FILENAME" $OUTPUTFOLDERtemp.pdf $OUTPUTFOLDERStatement-Pages-$LOCATION.pdf + mv $OUTPUTFOLDER/Statement-Pages-$LOCATION.pdf $OUTPUTFOLDER/temp.pdf + pdfunite "$FILENAME" $OUTPUTFOLDER/temp.pdf $OUTPUTFOLDER/Statement-Pages-$LOCATION.pdf else #IF the file doesn't exist create the file with the merge. - pdfunite "$FILENAME" $OUTPUTFOLDERStatement-Pages-$LOCATION.pdf + pdfunite "$FILENAME" $OUTPUTFOLDER/Statement-Pages-$LOCATION.pdf fi done