The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #3 (permalink)  
Old 03-19-2009
sunpraveen's Avatar
sunpraveen sunpraveen is offline
Registered User
  
 

Join Date: Jan 2009
Location: Pruthvi
Posts: 85
Try this:

Code:
cat filename | while read line
do
  fbinv_cnt=$(echo ${line} | grep -i "FBINV" | wc -l)
  if [[ ${fbinv_cnt} -eq 0 ]]; then
    line=$(echo "FBINV,${line}")
  fi
  echo ${line} >> outputfile.csv
done
HTH,

Regards,

Praveen