image
image

Go Back   macosx.com > Design, Media, Programming & Scripting > Software Programming & Web Scripting

Reply
 
Thread Tools
  #1  
Old February 6th, 2002, 01:16 PM
Registered User
 
Join Date: Feb 2002
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Profit is on a distinguished road
Question Batch HTML converting

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.
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off
Forum Jump

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


All times are GMT -5. The time now is 03:33 PM.


Mac Support® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0
Copyright 2000-2008 DigitalCrowd, Inc.