in reply to Re: HTML Formattting
in thread HTML Formattting
Well the html file that comes back to my program lets say test.html has certain entries like location country etc...
so the file looks like this
;Cost Center Desc.
;FX IT EFX;
;Town
;London ;
So what i want to do is search for town, and then grab the answer of the next line..
Something like $line =~ /Town/ , and the answer i am looking for is the next line which is London. You see these came from a table in html format, and i stripped out the html so i just have text, so this is what i am left with..
#!/home/cuthbe/bin/perl open(T,"test.html") || die ("Unable to open file. $!\n"); foreach (<T>) { s/<[^>]+>//g; s/ //g; s/<!//g; if($_ =~ /Town/) { printf $$; } #printf; }
Edited by Chady -- added code tags.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: HTML Formattting
by muntfish (Chaplain) on May 13, 2004 at 11:09 UTC | |
by minixman (Beadle) on May 13, 2004 at 14:35 UTC |