Checking the Empty line in csv file

Hi all,

I have one CSV file(MasterFile.csv) consists of two columns.

"./incoming/ABC.CSV","./incoming/ABC_CONTROL.txt"
"./incoming/PQR.CSV","./incoming/PQR_CONTROL.txt"

"./incoming/123.CSV","./incoming/123_CONTROL.txt"

I have written a script to read the MasterFile.csv.Here i want to check the Empty line entry and try to ignore during the script execution...

My script code snippet is follow

writeToLog "=====New Logs for data file validation====="
writeToLog "==========================================="

validateScript="./validateFile.sh"
masterFile="./MasterFile.csv"

if [ ! -f $masterFile -o ! -r $masterFile ];
then
#exit for now, it will check again when the next cron job runs
writeToLog "In Script $0: file $masterFile not found/readable"
exit 0
fi

if [ ! -f $validateScript -o ! -r $validateScript ];
then
#exit for now, it will check again when the next cron job runs
writeToLog "In Script $0: script $validateScript not found/readable"
exit 0
fi

writeToLog "In Script $0: Going to validate all data files listed in the master file - $masterFile"
count=0
while [ 1 ]
do
#execute the following block from the 2nd line onwards, which means skip the header row of the csv file
read entryLine || break
writeToLog "In Script $0: entryLine=$entryLine"
if [ $count -gt 0 ];
then
#index of the delimiter that separates the data file and control file names
index=`echo $entryLine | awk '{ print index($1,",") }'`
writeToLog "In Script $0: index of delimiter = $index"
#need to take the substring before the comma
index=`expr $index - 1`
#echo $entryLine | awk '{ print substr($1, 0, '$index') }'
dataFile=`echo $entryLine | awk '{ print substr($1, 0, '$index') }'`
writeToLog "In Script $0: current data file = $dataFile"
index=`expr $index + 2`
controlFile=`echo $entryLine | awk '{ print substr($1, '$index') }'`
writeToLog "In Script $0: current control file = $controlFile"
#invoke script - $validateScript
sh $validateScript $dataFile $controlFile
fi
count=`expr $count + 1`
#echo "count = $count"
done < $masterFile
writeToLog "In Script $0: Finished validation of all data files listed in the master file - $masterFile"

exit 0

PFA contains the required files..

Cheers
Soll

just to ignore empty lines

grep -v "^$" <filename>

Hi aju_kup

Could you guide me how to append the grep -v "^$" <filename> in the existing code.

I'm new to Unix Scripting.It will be very helpful to complete this task

Cheers

Soll

writeToLog "In Script $0: Going to validate all data files listed in the master file - $masterFile"
count=0
while [ 1 ]
do

#execute the following block from the 2nd line onwards, which means skip the header row of the csv file
read entryLine || break
writeToLog "In Script $0: entryLine=$entryLine"
if [ $count -gt 0 ];
then

Thanks a Lot Mr.aju_kup for you immediate reply...