|
#1
| |||
| |||
| Hi there, new to the boards. I apologize if there is an obvious solution to my problem that hasn't occurred to me. I'm writing a perl script that extracts data from HTML files. I plan to post a few perl questions in another topic. The HTML files are already in a standard format, but not one conducive to my planned method of extraction. Omniweb's 'reformat' button does a fine job for my purposes. Eg. I'd like it to take the following: <p><b>Area:</b> <br><i>total:</i> 652,000 sq km <br><i>land:</i> 652,000 sq km <br><i>water:</i> 0 sq km and turn it into: <b>Area:</b> <br> <i>total:</i> 652,000 sq km <br> <i>land:</i> 652,000 sq km <br> <i>water:</i> 0 sq km This way, I can create a big array of strings before and after the desired information and run something along these lines: if ($line =~ s/$searchy[$itr]//) { substr($line, -length($choppy[$itr])-2) = ""; print "<$taggy[$itr]>$line<\\$taggy[$itr]>\n"; } If anyone knows of a CLI (or otherwise for that matter) program that could batch process HTML formatting, I'd be greatly appreciative. I apologize for being long winded and appreciate your help. kdavis@uvic.ca edit: First post and I didn't realize this thing displayed HTML.. check the source if you can help. Thanks. |
![]() |
| Thread Tools | |
|
|
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| HTML (YES HTML) and CCS troubles... | Trip | Design & Media | 15 | November 20th, 2003 03:08 PM |
| OS 10.2.X and HTML browser: Full-screen HTML browser. What solution exists? | obeghain | Mac OS X System & Mac Software | 1 | January 1st, 2003 09:13 AM |
| a THOROUGH HTML DICTIONARY (on the comp), FRONTPAGE or summn similar 4 the MAC???? | Gate~Won | Design & Media | 4 | January 5th, 2002 09:12 PM |
| Text Edit and HTML | cutman1000 | Apple News, Rumors & Discussion | 1 | October 6th, 2001 06:46 PM |