I have 2 files: fileA and fileB.
content of fileA
---------------
admin.teacher is in new york;
admin.mason is in new york;
admin.driver is in new york city;
user.trucker is in hartford;
admin.developer is in new york state;
content of fileB
----------------
admin.teacher is in chigago;
user.teacher is in new york;
admin.mason is in new york;
admin.developer is in new york state
admin.plumber is in new york;
admin.driver is in new york city;
user.trucker is in hartford;
admin.nurse is in new york state;
admin.teacher is in new york
user.painter is in new york;
This is what I am trying to achieve:
I would like to loop through fileB and if any member in fileA
is found in fileB then that line in fileB will be commented with (--)
I am looking for a neat script to do this for me. thx.
This means that the resulting file to look like:
FileC
----------
admin.teacher is in chigago;
user.teacher is in new york;
--admin.mason is in new york;
--admin.developer is in new york state
admin.plumber is in new york;
--admin.driver is in new york city;
--user.trucker is in hartford;
admin.nurse is in new york state;
--admin.teacher is in new york
user.painter is in new york;