Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

HTML Forum


You are currently viewing our HTML Forum as a guest. Please register to participate.
Login



Post a Project »

Find a Professional HTML Freelancer!

Find a Freelancer to help you with your HTML projects

FREE Outsourcing eBook!

Reply
Removing SPAN, CLASS ect from multiple pages
Old 12-08-2006, 09:51 PM Removing SPAN, CLASS ect from multiple pages
Junior Talker

Posts: 3
Trades: 0
Hi,
I have several thousand pages created in NOF 7.


The code is a mess and I want to remove the CLASS, SPAN ect which exist for each bit of text.


Anyone know how this can be done automaticallly. A sample of the problem is below.


Note, I intend to have one global CSS file which sets all font to the same.
Sample below -



</select><input type="submit" value="Buy"name="submit"></div></form> </SPAN>
</B></P><P STYLE="text-align: center;"><B><SPAN STYLE="font-family: Arial,Helvetica,Geneva,Sans-serif,sans-serif; color: rgb(255,0,0);"><SPAN STYLE="color: rgb(255,255,255);"></SPAN><SPAN STYLE="font-size: 12pt;"></SPAN></SPAN><SPAN STYLE="font-size: small;"><SPAN STYLE="color: rgb(204,0,255);">_________________________________ _________________________</SPAN></SPAN></B></P><P STYLE="text-align: center;"><B><SPAN STYLE="font-size: small; color: rgb(204,0,255);"></SPAN></B>&nbsp;</P></TD><TD></TD>
</TR></TABLE></TD></TR></TABLE><TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0 WIDTH=791 NOF=LY><TR VALIGN=TOP ALIGN=LEFT><TD WIDTH=43 HEIGHT=9></TD><TD WIDTH=748></TD></TR><TR VALIGN=TOP ALIGN=LEFT><TD></TD><TD WIDTH=748 CLASS="TextObject" STYLE="background-color: rgb(0,0,0); background-image: none; border-left-style: none; padding-top: 5pt; border-top-style: none; border-right-style: none; padding-bottom: 5pt; border-bottom-style: none;"><P STYLE="text-align: justify; border-left-style: none;
border-top-style: none; border-right-style: none; border-bottom-style: none;"><TABLE WIDTH="100%" BORDER=0 CELLSPACING=0 CELLPADDING=0 NOF=TE><TR><TD ALIGN="CENTER"><TABLE WIDTH=748 BORDER=0 CELLSPACING=0 CELLPADDING=0 NOF=TE><TR><TD CLASS="TextObject" STYLE="border-left-style: none; border-top-style: none; border-right-style: none; border-bottom-style: none;"><P STYLE="text-align: justify; border-left-style: none; border-top-style: none; border-right-style: none; border-bottom-style: none;"><IMG
ID="Line2" HEIGHT=2 WIDTH=748 SRC="../../a_ArrowLine.gif" VSPACE=0 HSPACE=0 ALIGN="TOP" BORDER=0 ALT="">&nbsp;</P><P STYLE="text-align: justify; border-left-style: none; border-top-style: none; border-right-style: none; border-bottom-style: none;">&copy&nbsp;<I><SPAN STYLE="font-size: medium; color: rgb(255,255,255);"><A HREF="http://www.m-99.co.uk/"><B><SPAN STYLE="font-size: small; color: rgb(255,255,254);">M99</SPAN></B></A> <SPAN STYLE="font-size: x-small;">1999-2006&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <SPAN
STYLE="font-size: xx-small; color: rgb(255,255,1);">Unit A3, Enterprise Park, Brunel Drive, Newark, Nottinghamshire, United Kingdom. NG24 2DZ </SPAN> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
russell2002 is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 12-08-2006, 10:07 PM Re: Removing SPAN, CLASS ect from multiple pages
blackhawkpowers's Avatar
Ultra Talker

Posts: 313
Name: Dustin
Location: GA
Trades: 0
serveral thousand pages? phew..... going to have your work cut out for ya........

best thing I can think of is search the web for "multiple file find and replace" you'll need something that allows regular expressions though and then go from there..

sorry if this post seems very vague but it's a start for you......
__________________
A patch is a piece of software which replaces old bugs with new bugs.

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
blackhawkpowers is offline
Reply With Quote
View Public Profile Visit blackhawkpowers's homepage!
 
Old 12-08-2006, 10:52 PM Re: Removing SPAN, CLASS ect from multiple pages
Junior Talker

Posts: 3
Trades: 0
10227 pages to be precise.

I just did an autoreplace of 1 short tag, took 23 minutes.

And I rekon their are several hundred slightly different auto replaces to do.

O dear.
russell2002 is offline
Reply With Quote
View Public Profile
 
Old 12-09-2006, 05:51 AM Re: Removing SPAN, CLASS ect from multiple pages
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,383
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
A regular expression for removing style, class & id attributes in one pass

Code:
class="[^"]*["]|id="[^"]*["]|style="[^"]*["]
one for removing <span> & </span>
Code:
<span>|<span( [^>]*)[>]|<(/)span>
Note: Neither of these will remove a matching line completely if the line is split with a CR (as can happen with HTML)
EG:
<span style="blah">Some text</span> will become Some Text

but
<span style=
"blah">Some text</span> will become "blah">Some Text
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 12-09-2006, 11:00 AM Re: Removing SPAN, CLASS ect from multiple pages
LadynRed's Avatar
Defies a Status

Posts: 10,017
Location: Tennessee
Trades: 0
You might want to look at HTML Tidy, it has the capability to clean up code and you can set your preferences.

Dreamweaver has a search and replace with regular expressions and you can tell it to do it site-wide.
__________________
Web Goddess & Web Standards Evangelist :) - Tables Be Gone !!

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

LadynRed is offline
Reply With Quote
View Public Profile
 
Old 12-09-2006, 04:33 PM Re: Removing SPAN, CLASS ect from multiple pages
Novice Talker

Posts: 6
Name: Jon
Trades: 0
I think the suggestion by LadynRed would suit you best -- using DreamWeaver (or something of the like) to do a sitewide find and replace.
__________________
Jon - Albany NY

Please login or register to view this content. Registration is FREE
and
Please login or register to view this content. Registration is FREE
shockent is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Removing SPAN, CLASS ect from multiple pages
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.63665 seconds with 12 queries