Hi,
I want to search the log file for a string and extract all data until the end of that line where the search string is found.
For example:
A line in the file reads like below:
[28/04/2010 11:17:53 GMT]PositionPoolCalculation.java(339):getPosCalculation[INFO]BUNP: B123456:1234567:ABCD ANP: B123456:1234567:ABCD:2 post LCN: DESabcdefgh
I want to search for string BUNP and then extract "B123456:1234567:ABCD ANP: B123456:1234567:ABCD:2 post LCN: DESabcdefgh"
while ($record = <INPUT>){
# the below condition reads until the work LCN, but I need it until the end of the line
if ($record =~ m/BU_NP: (.*?) LCN/) {
print "$1\n";
}
else{
print "No Match\n";
}
};
Any help would be appreciated!
Thanks