kavitha has asked for the wisdom of the Perl Monks concerning the following question:
I have never posted a question here. I would really appreciate if any one can answer this. Please let me know if the question is not clear
I have 2 files which are file1 and file2. I need to search for each of the lines from file1 in file2. And if it exists then comment that line in file2. The line thats being searched will be just part of the line in file2.
Ex:
Text in file1:
perlmonks
Text in file2:
I am in perlmonks
I am posting question
output file which is again file2 should look like this:
#I am in perlmonks
I am posting question
I have 2 files which are file1 and file2. I need to search for each of the lines from file1 in file2. And if it exists then comment that line in file2. The line thats being searched will be just part of the line in file2.
Ex:
Text in file1:
perlmonks
Text in file2:
I am in perlmonks
I am posting question
output file which is again file2 should look like this:
#I am in perlmonks
I am posting question
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: how to comment the lines if found a match
by lostjimmy (Chaplain) on Dec 05, 2008 at 18:55 UTC | |
Re: how to comment the lines if found a match
by moritz (Cardinal) on Dec 05, 2008 at 18:53 UTC | |
Re: how to comment the lines if found a match
by ww (Archbishop) on Dec 05, 2008 at 20:55 UTC | |
by kavitha (Initiate) on Dec 05, 2008 at 21:49 UTC | |
by gwadej (Chaplain) on Dec 05, 2008 at 21:59 UTC | |
Re: how to comment the lines if found a match
by n3toy (Hermit) on Dec 06, 2008 at 00:18 UTC | |
by matrixmadhan (Beadle) on Dec 06, 2008 at 14:15 UTC | |
by kavitha (Initiate) on Dec 08, 2008 at 23:44 UTC |
Back to
Seekers of Perl Wisdom