I am trying to get awk to search a file called $filetoDownload
check for matching files and place them in palocal_check/dirs.txt
it will them cut out the first 10 fields and place them in
dirsfound.txt
The code as it looks now is as follows:#get the factset file
filetoDownload=`echo $acct | awk -F',' '{print $1}'`
\#get the xls file to download
XlsfiletoDownload=\`echo $acct | awk -F',' '\{print $1\}'\`
filetoDownload=\`echo $acct | awk -F',' '\{print $2\}'\`
filetoDownload=\`echo $filetoDownload | awk -F'_' '\{print $1"\_"$2"\_"$3"_"$4\}'\`
printLog "searching for $\{filetoDownload\}"
\#\#awk -F, '/'$filetoDownload'/ \{print $2\}' $palocal_check/dirs.txt > $palocal_check/dirsfound.txt
\#\#cut -d "/" -f2-10 $palocal_check/dirs.txt > $palocal_check/dirsfound.txt
awk -F, '/'$filetoDownload'/ \{print $1"/"$2"/"$3"/"$4"/"$5\}' $palocal_check/dirs.txt > $palocal_check/dirsfound.txt
cat $palocal_check/dirsfound.txt
DirectoryFound=\`cat $palocal_check/dirsfound.txt\`
\#did we get a match