Hi,
i have the following code in which i am passing array tldn in awk using -v option & despite of that condition is not getting matched,can somebody suggest how to handle shell arrays in awk
tcount=(9875 9667)
awk -F"\t" -v ltldn="${tldn[*]}" 'NR==FNR {POSTPAIDMDNS[$1]=$2"|"$3;next}
function ceil(val) { return (val == int(val)) ? val : int(val)+1}
{
(substr($6,length($6)-9,10) in POSTPAIDMDNS && $7 !~ "[A-Z,a-z]" && (substr($20,length($20)-9,4) !~ ltldn))
print POSTPAIDMDNS[$6]
' FS="\t" PP.txt SS.MRC
IP file is as follows:
PP.txt:
9875222100 1000000426 15
9875040009 1000001576 1
1415101350 1000000300 1
SS.MRC:
386 130 23:59:31 11/30/2013 0 9875222100 919929377903 45 0 0 0 0 0 0 Ms null 404001742760058 null null 9667920916 null null IN 00:00:16 null null 0 null 404009875008997 404009875008997 3501661179
603 130 23:59:49 11/30/2013 0 9875040009 919414288049 41 0 0 0 0 0 0 Ms null 404001742768413 null null 9137920523 null null IN 00:00:30 null null 0 null 404009875008997 404009875008997 3501661261