DS has asked for the wisdom of the Perl Monks concerning the following question:
where the fist number appear in each line is a line number in that code now in my second file which is lineChanges.txt , I have the followingme.pl~23~note~345~sente you.pl~25~warning~345~sente he.pl~21~note~345~sente she.pl~123~warning~345~sente they.pl~233~warning~345~sente them.pl~26~note~345~sente
which are lines that changed in a code, 24-28 means 24 to 28 ... so what I need to do is reading from the lineChanges.txt file each line and see if the .pl file appears in the first file data.txt , if it does then I want to see if the lines number matches or in the same range and it is a warning , if it match and it is a warning then I want to get the hole line and send it to a file . example you.pl appears in both files the lines for you.pl in the lineChanges.txt are 24 to 28 and in data.txt is 25 , line 25 which is in the range of 24-28 appear and it is a warning so that is what I am looking for so I copy the hole lineyou.pl 24-28 they.pl 36 them.pl 44-49 you.pl 234 77
to an output file .... can someone tell me how to do that or give me a hint :) thanksyou.pl~25~warning~345~sente
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Reqex from two files and compare
by aersoy (Scribe) on Jul 17, 2002 at 04:02 UTC | |
by DS (Acolyte) on Jul 17, 2002 at 04:34 UTC | |
|
Re: Reqex from two files and compare
by graff (Chancellor) on Jul 17, 2002 at 04:54 UTC | |
by DS (Acolyte) on Jul 17, 2002 at 05:03 UTC |