|
compare two files
I have file1 and file2:
file1:
11 xxx kksd ...
22 kkk kdsglg...
33 sss kdfjdksa...
44 kdsf dskjfkas ...
hh kdkf kdkkd..
jg dkf dfkdk ...
...
file2:
jg
22
hh
...
I need to check each line of file1. if the field one is in file2, I will keep it; if not, the whole line will be discarded. The result file will be:
jg dkf dfkdk ...
22 kkk kdsglg...
hh kdkf kdkkd..
...
please tell me how I can do this, thanks!
|