1

how to find lenght of fixed width file record?

view story
linux-howto

http://www.unix.com – actually i am trying to find the lenght of fixed width file record reading from teradata db but its not working can u guys help me out? code which i wrote--- colmn_lngth=`cat $RPT_FILE | awk -F~ '{print $1}'` rm $RPT_FILE while read line do result=`echo $line | wc -m` result=`expr $result - 1` if [ $result -le $colmn_lngth ]; then echo $line >> $Src_File.temp else echo $line >> $Src_File.bad fi done < $Src_File but in file if record is having spaces in between then its not counting tht spaces so it is creating wrong validatio (HowTos)