pillaib
asked on
pattern matching
Hi
Below is text file...
Please help me grepping out the text between the tags <LOC> and </LOC>.
<LINE><ADM>DOLNOSLASKIE</A
Name</TYPE><ADMSYN>WALBRZY
<LINE><ADM>DOLNOSLASKIE</A
CO></LINE>
<LINE><ADM>DOLNOSLASKIE</A
OCO></LINE>
<LINE><ADM>DOLNOSLASKIE</A
O></LINE>
waiting for a favourable reply
Regards
Biju Pillai
while( /<LOC>(.*?)<\/LOC>/g ){
print "$1\n";
}
print "$1\n";
}
or as a single line
print "$1\n" while (/<LOC>(.*?)<VLOC>/);
print "$1\n" while (/<LOC>(.*?)<VLOC>/);
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Nothing has happened on this question in over 7 months. It's time for cleanup!
My recommendation, which I will post in the Cleanup topic area, is to
accept answer by hemaraj123.
Please post any comments here within the next seven days.
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
jmcg
EE Cleanup Volunteer
My recommendation, which I will post in the Cleanup topic area, is to
accept answer by hemaraj123.
Please post any comments here within the next seven days.
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
jmcg
EE Cleanup Volunteer
This should work
if ( /<LOC>(.*)<\/LOC>/ ) {
print "$1\n";
}