Is there anyway to get this through Unix shell scripting?
I have a fileA with one column (1000 rows), and fileB with 26 columns(13000 rows).
I need to search each value of fileA with fileB and return all the 26 values from FileB if matches. The search value (from FileA) may present in any of the 26 values in FileB. This value is not fixed in any of the columns in B file.
FILEA:
abc
def
ghi
FILEB:
drm|fdm|pln|ess|abc|zeh|....|yer (26 values)
fdm|drm|def|ess|yer|zeh|....|pln
Here, abc
from fileA is 5th col. of FileB—so my result should be all the 26 values from FileB.
Similarly, def
from fileA is 3rd col. of FileB -so my result should be all the 26 values from FileB.
This way, need to do for the entire record set.
If unmatched, ignore the record.
Best Answer
You can just use
grep
:From
man grep
: