How to cut the particular string and increment the rows .?

view full story

http://www.unix.com – Hi am using unix aix Quote: I have a .txt files in a format . vv |xcvb| qa |cerd| za |qwer| Quote: I Need output likes this output=x output=c output=q Code: I have tried using awk but am getting only output = x ,its not incrementing next output   set -A var1 vv qa za ct=0 i=3 while [ $ct -lt 3 ] do var1=`echo ${var1[$ct]}` count=`awk ' NR==$i++ {print;exit}' ${.txt} | cut -c5 ` echo $count let ct=ct+1 done Can anyone help me how to increment NR (HowTos)