How can we use fgrep command to search pattern on perticular field on a file.
eg : I have a parren file having format
cat patternfile
SPA16S199982
SPA5S26330
I want to seach these pattern on FIRST field of File2(since other field has
same data) and that too maching entirely.
You can not use fgrep for this purpose, you have to use grep. Also you can not use the -x option since that matches the whole line, plus you can not use the pattern unmodified. So you either have to modify the pattern file or modify the patterns on the fly:
Hi All, the awk command is working fine Thanks a lot .Now the major think is my pattern file and main file has 5million data. In that case will the awk command be faster ?