Hi. I've got a bunch of text files that have a lot of different information in them, but I want to make sure that certain particular lines have matching information. Even if I could get it to spit out the same lines from each that would be good, but it would be nice to let the machine do the comparison.
For example, I have a line that says
FileA path1/xxx_123_Jim_yyy.zzz
but in the other file the line is
FileA path2/aaa_123_Jim_bbb.zzz
This is a good match because the 123_Jim part in both is the same.
I have several lines I want to compare, but there are many many lines in these files that are not going to be the same, so diff or comm don't seem to be the things I'm after. Also, the text I am interested in don't necessarily have to be on the same numbered line.
Code:
grep-w FileA | awk -F_ ' {print $2,$3} '
will pull the info I want to compare out of the correct lines out for me (once I get the correct files to compare in a list), but what do I do from there? I was thinking of making new files with > and comparing those with diff, but that seems to be inefficient to me.
Thanks.