I have one array SPLNO with approx 10k numbers.Now i want to search the subscriber number from MDN.TXT file (containing approx 1.5 lac record)from the array.if subscriber number found in array it will perform below operation.my issue is that it's taking more time because for one number it's search whole array of 10k records. therefore for 1.5 lac records it's looping around (1.5lac*10K). please suggest efficient ways.Sample SPLNO.TXT:918542054921|30|1|2918542144944|12|1|2918542155955|12|1|2918542166966|12|1|2918542255955|12|1|2918542355955|12|1|2918542455955|12|1|2918542555955|12|1|2918542955955|12|1|2  Sample MDN.TXT:854216696685423559558542555955  awk -F|  'FNR==1 { ++counter}counter==1 {SPLNOPULSE[$1]=$4;SPLNOAMT[$1]=$3;SPLNOMAXLEN[$1]=$2;next}{for ( mdn in SPLNOMAXLEN)        {         if ( ($1 ~ ^mdn && length($1) <=SPLNOMAXLEN[mdn]) || (91$1 ~ ^mdn && length(91$1) <=SPLNOMAXLEN[mdn]) )              {                                              print found               }         else                print not found        }                              } ' SPLNO.TXT MDN.TXT
Efficient way to search array in text file by AWK
text processing;awk;array;for