HighDots Forums  

how to easily convert old html content to new html format?

Website Design comp.infosystems.www.authoring.site-design


Discuss how to easily convert old html content to new html format? in the Website Design forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
lohroffe
 
Posts: n/a

Default how to easily convert old html content to new html format? - 08-20-2003 , 02:05 PM






I am upgrading a web site that was authored in some kind of program called
Wizard or something like that. So, the code contains all sorts of blank
divs, and other assorted crap that I don't want in my new, pretty, code.
I'm hand coding using TextPad.

There are probably 50 pages that I need to convert to the new format. The
pages are very text-intensive, and the text is in many short paragraphs.

My dilemma is this - if I copy and paste the *code* directly, then I have to
search and replace which would probably kill me!

BUT if I just copy and paste the *text*, then I lose all of the formatting
that I DO want to keep (like bolded words, etc.)

I do NOT want to take the easiest route: just linking to the old pages...
SHUDDER - they are, well, NOT attractive!

Suggestions?



Reply With Quote
  #2  
Old   
Els
 
Posts: n/a

Default Re: how to easily convert old html content to new html format? - 08-20-2003 , 02:14 PM






lohroffe wrote:

Quote:
I am upgrading a web site that was authored in some kind of program called
Wizard or something like that. So, the code contains all sorts of blank
divs, and other assorted crap that I don't want in my new, pretty, code.
I'm hand coding using TextPad.

There are probably 50 pages that I need to convert to the new format. The
pages are very text-intensive, and the text is in many short paragraphs.

My dilemma is this - if I copy and paste the *code* directly, then I have to
search and replace which would probably kill me!
Why would search and replace 'kill' you?
For example: if 90% of all the divs are empty, take out all
the divs, and code the necessary divs by hand... or am I
missing something?


--
Els

A mente é egual á uma paraqueda; funciona melhor aberta.



Reply With Quote
  #3  
Old   
Alan J. Flavell
 
Posts: n/a

Default Re: how to easily convert old html content to new html format? - 08-20-2003 , 02:34 PM



On Wed, Aug 20, lohroffe inscribed on the eternal scroll:

Quote:
I am upgrading a web site that was authored in some kind of program called
Wizard or something like that. So, the code contains all sorts of blank
divs, and other assorted crap that I don't want in my new, pretty, code.
I'm hand coding using TextPad.
HTMLtidy with your choice of option settings.



Reply With Quote
  #4  
Old   
lohroffe
 
Posts: n/a

Default Re: how to easily convert old html content to new html format? - 08-20-2003 , 02:36 PM



"Els" <els.aNOSPAM (AT) PLEASEtiscali (DOT) nl.invalid> wrote


Quote:
Why would search and replace 'kill' you?
For example: if 90% of all the divs are empty, take out all
the divs, and code the necessary divs by hand... or am I
missing something?
Search and replace would kill me because sometimes there are hard returns
between the codes, sometimes tabs, sometimes a blank <b> inserted between,
and on and on, and to figure out all of the permutations that s&r would
require... dead for sure!

So, any other ideas of how to take care of my problem?

lohroffe




Reply With Quote
  #5  
Old   
Giles Chamberlin
 
Posts: n/a

Default Re: how to easily convert old html content to new html format? - 08-21-2003 , 05:29 AM



"lohroffe" <lohroffe (AT) bigfoot (DOT) forgetthespam.com> writes:
Quote:
Search and replace would kill me because sometimes there are hard returns
between the codes, sometimes tabs, sometimes a blank <b> inserted between,
and on and on, and to figure out all of the permutations that s&r would
require... dead for sure!

So, any other ideas of how to take care of my problem?
Sound's like it's time to learn about regular expressions. It'll take
you a while the first few times, but at the end you'll have acquired a
new skill that you can use again.

If your editor doesn't have regex support, have a look at sed:
http://www.student.northpark.edu/pemente/sed/
It's a standard UNIX tool, ported to other operating systems,
including Windows.

have fun!

--
Giles Chamberlin






Reply With Quote
  #6  
Old   
lohroffe
 
Posts: n/a

Default Re: how to easily convert old html content to new html format? - 08-22-2003 , 06:20 PM



Giles Chamberlin wrote:

Quote:
Sound's like it's time to learn about regular expressions. It'll take
you a while the first few times, but at the end you'll have acquired a
new skill that you can use again.
I do know about regular expressions, however, sometimes there is one line
between codes, sometimes 2, blah blah blah. It's not consistent and the
pages were created over the course of about 4 years, content from different
authors who use different formatting...

Peter Stokes wrote:

Quote:
Sounds like the original creator just did a Word document 'save as
HTML' - just about the most criminal act that can be perpetrated on
the web.
Well, then this is the second most criminal act. I've seen the Word "code"
and this is about as butt-ugly.

Quote:
If I was you I'd bite the bullet and just copy the text and reformat
it. At least you'd then know that everything in the HTML files was
your and yours alone.
The long and the short (actually the long-er) of it...I've spent about 6
hours so far doing search and replace, using regular expressions. I
estimate I'm 85% done. I underestimated the ugliness of the problem - there
weren't 50 html pages, there were 139.

Then I'm taking the cleaned-up code and pasting it into the "page content"
section of my new template.

I probably should have done what you suggested - copy the text - that's what
hubby the programmer said, too.

I tried to figure out how to use htmltidy, as suggested in a previous post,
but couldn't get it to work for me. Perhaps I put it in the wrong directory
in WinXP for an executable...? The directions weren't too clear, if you ask
me.

Thanks for the input, all! If there are any more suggestions, I'd welcome
them!

lohroffe




Reply With Quote
Reply




Thread Tools
Display Modes

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.