1

Reading last line of a CSV file

view story
linux-howto

http://www.unix.com – Hi I have a file which I am reading line by line and processing it. But the last line is not getting read in the file loop until I put an enter in the end. Code: #!/bin/ksh -p v_org_id=${P1} FILE=${P2} NEW_FILE_NAME=$APPLPTMP/b1.txt BAKIFS=$IFS IFS=$'\n' exec 0<"$FILE" echo "File to be processed.....: ${FILE}"  while read -r line do v_initial=`echo "$line" |cut -d'|' -f1-3` echo "v_initial.....: ${v_initial}" v_last_name=`echo "$line" |cut -d'|' -f4` v_first_name=`echo "$line" |cut -d'|' -f5` OUTPUT=`sqlplus -s ${LOGIN} (HowTos)