Hi Team,
I have a file which contain following data like
BKP0000032183140217000019 053IGZYEVSDOX .........field 2....... field3.....field4.....
BKP0000032284140217000019CCTP1220 ...............
BKP0000032384140217000019CA .....................
each line has 5 fields
Now using shell script i am trying to extract field 4 based on condition that line start with BKP and contain code 84 and CA or CC
code
grep -A12 " RFND " xfer_BSPDe | grep "^BKP" >file2.txt
While read line
do
awk '{if((substr($1,12,2)==84) && (substr($1,26,2)=='CC' || substr($1,26,2)=='CA') ) print $4;else print "0"}'
done<file2.txt
it is printing 0 only .
any help is appreciable.