Filter out lines of a cvs from values from an other file

Hi there,

I have a comma seperated file which looks like

16-Jun-08,KLM forwarder,,AMS,DXB,AMS,C,Y,G10,074-02580900,milestone failed - message not received,C,OK,,13/06/2008 00:00,KL427,13/06/2008 00:00,KL427,Rebooked,C,milestone failed - message not received,milestone failed - evented late,C,,milestone failed - evented late,C,,OK,
16-Jun-08,KLM forwarder,,AMS,HEL,AMS,C,Y,,074-02580911,milestone failed - message not received,C,OK,,13/06/2008 00:00,KL1169,13/06/2008 00:00,KL1169,Rebooked,C,milestone failed - message not received,milestone failed - message not received,C,,milestone failed - message not received,C,,milestone failed - message not received,C
17-Jun-08,KLM forwarder,,AMS,ZRH,AMS,C,Y,,074-02580922,milestone failed - message not received,C,OK,,14/06/2008 00:00,KL1957,14/06/2008 00:00,KL1957,Rebooked,C,milestone failed - message not received,OK,,,OK,,,OK,
16-Jun-08,KLM forwarder,,AMS,HEL,AMS,C,Y,,074-02580933,milestone failed - message not received,C,OK,,13/06/2008 00:00,KL1171,13/06/2008 00:00,KL1171,Rebooked,C,milestone failed - message not received,milestone failed - message not received,C,,milestone failed - message not received,C,,milestone failed - message not received,C

and an other file which has a list of number like:

074-26315295
074-26315155
074-26315240
074-26315354

so what I want to do is to get those lines from the csv file where the value of the 10th field is in the list of the numbers I have in the other file.

Can somebody help me with this?

awk -F',' 'NR==FNR{_[$1];next} $10 in _{print}' filter data

Works great, just I had to change my filter file to unix style only with LF. But can you please explain it to me because I don't get it how it works.

Thanks

Here is the explanation:

awk -F',' '      # Set FieldSeparator to (,).
NR==FNR          # While the condition NR==FNR is true. 
{_[$1];next}     # build the array (_) with all the elements from field 1 of the filter file
$10 in _{print}  # For each RS having $10 in array (_), print RS
' filter data