From 5252fc1932b04adb8b6653d8b0237ab01a3229d1 Mon Sep 17 00:00:00 2001 From: sharkmccoy Date: Fri, 18 Dec 2020 13:14:05 -0500 Subject: [PATCH] Created files --- Find_Missing_Addresses.sh | 43 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 Find_Missing_Addresses.sh diff --git a/Find_Missing_Addresses.sh b/Find_Missing_Addresses.sh new file mode 100644 index 0000000..8098132 --- /dev/null +++ b/Find_Missing_Addresses.sh @@ -0,0 +1,43 @@ +#!/bin/bash + + +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 +while : +do + echo -e "What is the output directory for the pdf's with missing addresses?" + #read OUTPUTFOLDER + OUTPUTFOLDER=/home/btmccrea/Documents/ouput + if [ -d $PDFDIR ]; then + break + else + echo -e "Directory not found." + fi +done + + +FILES=$(ls $PDFDIR) +cd $PDFDIR +echo $FILES +for f in "$FILES" + do + pdftotext $f - | TEMPFILE + ADDRESS=$(awk 'NR == 14 {print ; exit}' TEMPFILE) + echo $ADDRESS + if [ -z $ADDRESS ]; then + cp $f to $OUTPUTFOLDER + fi + done +exit + + +