Accessing input from another file

Hi,

Let me make it clear, Im having two .lst files.

In 1st file Im having only one column,while in 2nd im having 8 columns.

I need to take the input from 1st file, I need to check the column1 in the first file with the 3rd colmn in the 2 nd file , and only the matching records should only captured.

Like wise i need to process all the records in the 1 st and 2 nd file.

plz help me out.

Thanks,
Mohana Krishnan

awk 'BEGIN{ while ( getline < "a1" ) { arr[$0]++ } }{ if ( $3 in arr ) print }' a2

Always it would be better if you could post sample input and output needed !

thanks for your response,

The matched record should be capturd in the another file.

My 1st file wl be like :

abbi~
abrego~
achen~
ahansen~
aidan~
alanbm~
alanc~
albert1~
albertl~
aliceh~

My sencond fiel will be :

0~Neo Fin Product Management Users~kellyv~
0~Neo Fin Product Management Users~kevinc~
0~Neo Fin Product Management Users~kneff~
0~Neo Fin Product Management Users~krithika~
0~Neo Fin Product Management Users~nilesh~
0~Neo Fin Product Management Users~scruton~

.I need only the matching columns n the 3 rd file.