in reply to Re: Fetching unique info
in thread Fetching unique info

Thanks, But the problem is the number 113 changes and that is the number I am trying to print. Whatever the new number that replaced 113 is the number I am trying to fetch and print. I tried this and it doesnt work:
my $got = q!<A HREF="JavaScript:AFunction('AA', 'B','0','Project','(\d +{3}')">San Francisco (Manager)!; print $got;

Replies are listed 'Best First'.
Re: Re: Re: Fetching unique info
by cbro (Pilgrim) on Jun 05, 2003 at 14:50 UTC
    What about something like this, assuming all of the lines will follow the same pattern. Given file lines such as:
    <A HREF="blah('aa','b','0','Project','112)"> Some Label Without Any Digits
    Do:
    open(F,"file.html"); @array = <F>; close (F); foreach (@array) { if (/\d/) { my ($s1,$s2,$s3,$s4,$needednumber) = split(/,/); $needednumber =~ s/[^\d]//g; print $needednumber . "\n"; } }