thanx a lot....its working
---------- Post updated 08-05-09 at 01:22 AM ---------- Previous update was 08-04-09 at 09:15 AM ----------
actually again i am facing some problem
if am doing like this
nawk -F":" '{printf("%-20.20s:%-20.20s:%-20.20s:%-20.20s:%-15.15s:%-3.3s:%-19.19s:%-2.2s:%-20.20s:%-15.15s:%-2.2s\n", $1,$2,$3,$4,gsub(/[^0-9]/,"",$5),$6,$7,$8,$9,$10,$11)}' $DIALPBIN/temp1.txt > ${DIALPBIN}/temp2.txt
echo "TRLR|${count1}" >> ${DIALPBIN}/temp2.txt
then the output comes out to be like this
hyperarc :199.37.175.53 :hyperarc :199.37.175.53 :3 :wn3:dial10 :3
:syrnypritc :PALMYRA :NY
hyperarc :199.37.175.53 :hyperarc :199.37.175.53 :0 :wn3:dial10 :3
:fbkaklocal :FAIRBANKS :AK
hyperarc :199.37.175.53 :hyperarc :199.37.175.53 :0 :wn3:dial10 :3
:syrnypritc :POPLAR RIDGE :NY
hyperarc :199.37.175.53 :hyperarc :199.37.175.53 :0 :wn3:dial10 :3
:syrnypritc :ROME :NY
see the fifth field only 3 has come..
if am using gsub in front of print like:
nawk -F":" '{gsub(/[^0-9]/,"",$5) ; printf("%-20.20s:%-20.20s:%-20.20s:%-20.20s:%-15.15s:%-3.3s:%-19.19s:%-2.2s:%-20.20s:%-15.15s:%-2.2s\n", $1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11)}' $DIALPBIN/temp1.txt > ${DIALPBIN}/temp2.txt
echo "TRLR|${count1}" >> ${DIALPBIN}/temp2.txt
then i am getting the file like this
hyperarc 199.37.175.53 hyperarc 199.37.175.53 315479980 3 dial10 3
hyperarc :199.37.175.53 :hyperarc :199.37.175.53 :315479980 :wn3:dial10 :3
:syrnypritc :PALMYRA :NY
hyperarc :199.37.175.53 :hyperarc :199.37.175.53 :9074516030 :wn3:dial10 :3
:fbkaklocal :FAIRBANKS :AK
hyperarc :199.37.175.53 :hyperarc :199.37.175.53 :3155639010 :wn3:dial10 :3
:syrnypritc :POPLAR RIDGE :NY
see the fiorst line is getting repeat and without colons..
what to do....