awk partial match and filter records

Hi,

I am having file which contains around 15 columns, i need to fetch column 3,12,14 based on the condition that column 3 starts with 40464

this is the sample data

how to achieve that

awk 'substr($3,1,5) ~ /40464/{print $3,$12,$14}' filename

cheers,
Devaraj Takhellambam

awk '$3~/^40464/{print $3,$12,$14}' filename

Hi, aemunathan:

If the data is as in your sample, spread out across 4 rows:

paste -d' ' - - - - < data | tr -s ' ' | cut -d' ' -f3,12,14 | grep ^40464

If in case the columns are all in a single row:

cut -d' ' -f3,12,14 data | grep ^40464

Regards,
Alister