Web Design Web Design Forum
Registration is free! Here you can view your subscribed threads, work with private messages and edit your profile and preferences Calendar Find other members Frequently Asked Questions Search
Home Web Design

Convenient web based access to our favorite web design Usenet groups

web design reviews

This is Interesting: Free Magazines for Graphics designers and webmasters  





  Last Thread  Next Thread
Author
Thread Post New Thread   

Wtd: HTML editor to swap the order of columns in tables
 

Andy Mabbett




quote this post edit post

IP Loged report this post

Old Post  08-27-06 - 11:39 PM  
I have an HTML document which has a long table, with five columns.

I want to swap the order of columns four and five, without breaking
(indeed, without otherwise altering) the valid markup.

Is there a tool which will allow me to do this?

(Cross-posted; comp.infosystems.www.authoring.html used, as I don't
receive comp.infosystems.www.authoring.tools)

--
Andy Mabbett
Say "NO!" to compulsory ID Cards:  <http://www.no2id.net/>

Free Our Data:  <http://www.freeourdata.org.uk>


Post Follow-Up to this message ]
Re: Wtd: HTML editor to swap the order of columns in tables
 

Paul Lutus




quote this post edit post

IP Loged report this post

Old Post  08-27-06 - 11:39 PM  
Andy Mabbett wrote:

>
> I have an HTML document which has a long table, with five columns.
>
> I want to swap the order of columns four and five, without breaking
> (indeed, without otherwise altering) the valid markup.
>
> Is there a tool which will allow me to do this?

Yes. It's called a "Regular Expression Processor", and it is part of most
modern programming languages.

Untested example script (Ruby):

-------------------------------

#!/usr/bin/ruby -w

data = STDIN.read

data.gsub!(%r{(<tr><td>.*?</td><td>.*?</td><td>.*?</td> )(<td>.*?</td>
(<td>.*?</td> )}m,"\\1\\3\\2")

puts data

------------------------------

Use:

scriptname < input.file > output.file

Or, you could download my freeware HTML workshop Arachnophilia and write the
above regular expression into its search/replace window. That would be
easier for an end user, while the above Ruby script is easier and more
flexible (will process any number of files by simply naming them) for a
more advanced computer user.

In the long term, it is much more productive to learn how to process HTML
using scripts that contain regular expressions.

Arachnophilia:

http://www.arachnoid.com/arachnophilia/index.html

--
Paul Lutus
http://www.arachnoid.com


Post Follow-Up to this message ]
Re: Wtd: HTML editor to swap the order of columns in tables
 

Ben Jamieson




quote this post edit post

IP Loged report this post

Old Post  08-27-06 - 11:39 PM  
On 2006-08-27 07:05:54 -0400, Andy Mabbett
<usenet200309@pigsonthewing.org.uk> said:

>
> I have an HTML document which has a long table, with five columns.
>
> I want to swap the order of columns four and five, without breaking
> (indeed, without otherwise altering) the valid markup.
>
> Is there a tool which will allow me to do this?
>
> (Cross-posted; comp.infosystems.www.authoring.html used, as I don't
> receive comp.infosystems.www.authoring.tools)

If you're not comfortable with RegEx/perl/scripting etc (many aren't)
then DreamWeaver will do this with a simple 'Cut/Paste' option.

Might be an easier way to go.

Ben



Post Follow-Up to this message ]
Re: Wtd: HTML editor to swap the order of columns in tables
 

AES




quote this post edit post

IP Loged report this post

Old Post  08-27-06 - 11:39 PM  
In article <GdB7OoUSyX8EFw7h@pigsonthewing.org.uk>,
Andy Mabbett <usenet200309@pigsonthewing.org.uk> wrote:

> I want to swap the order of columns four and five, without breaking
> (indeed, without otherwise altering) the valid markup.
>
> Is there a tool which will allow me to do this?

Excel?  (or other low cost spreadsheet)


Post Follow-Up to this message ]
Re: Wtd: HTML editor to swap the order of columns in tables
 

KBB




quote this post edit post

IP Loged report this post

Old Post  08-28-06 - 11:40 PM  
Ben Jamieson <ben@thymeonline.com> wrote:

> If you're not comfortable with RegEx/perl/scripting etc (many aren't)
> then DreamWeaver will do this with a simple 'Cut/Paste' option.

And create shit code? Besides, it's not a freeware solution.

KBB



Post Follow-Up to this message ]
Re: Wtd: HTML editor to swap the order of columns in tables
 

blanketyblankman@gmail.com




quote this post edit post

IP Loged report this post

Old Post  08-29-06 - 11:46 PM  
AES wrote:
> In article <GdB7OoUSyX8EFw7h@pigsonthewing.org.uk>,
>  Andy Mabbett <usenet200309@pigsonthewing.org.uk> wrote:
> 
>
> Excel?  (or other low cost spreadsheet)

Google Spreadsheet? =)



Post Follow-Up to this message ]
Re: Wtd: HTML editor to swap the order of columns in tables
 

Andy Dingley




quote this post edit post

IP Loged report this post

Old Post  08-29-06 - 11:47 PM  
Andy Mabbett wrote:

> I want to swap the order of columns four and five, without breaking
> (indeed, without otherwise altering) the valid markup.

Time to learn regexes.

Then probably find yourself an editor that allows reasonable regex
processing, and to allow this processing to be applied only to a
highlighted selection. You could do it over the whole file with sed,
but that's often ghastly if you're just re-arranging one chunk of a
large file.

Sadly most editors that "support regexes" have bizarre, inconsistent
and partial ideas about regex syntax. Be careful here, especially with
TextPad -- try jEdit.



Post Follow-Up to this message ]
Re: Wtd: HTML editor to swap the order of columns in tables
 

Al Klein




quote this post edit post

IP Loged report this post

Old Post  08-29-06 - 11:47 PM  
On 29 Aug 2006 03:00:46 -0700, "Andy Dingley" <dingbat@codesmiths.com>
wrote:

>Then probably find yourself an editor that allows reasonable regex
>processing, and to allow this processing to be applied only to a
>highlighted selection. You could do it over the whole file with sed,
>but that's often ghastly if you're just re-arranging one chunk of a
>large file.

Or take the chunk that has to be changed to another file by itself,
change it and paste it back, if doing the whole file is easier.


Post Follow-Up to this message ]
Sponsored Links
 





All times are GMT. The time now is 05:34 PM. Post New Thread   
  Previous Last Thread   Next Thread next
Webmaster forum archive | Show Printable Version | Email this Page | Subscribe to this Thread

Popular forums

Adobe Photoshop forum Macromedia Flash Web Site Design
Dreamweaver FrontPage forum
JavaScript Forum XML forum
Style Sheets VRML
Forum Jump:
Rate This Thread:

 

XML RSS Feed web design latest articles Syndicate our forum via XML or simple JavaScript

Web Design archive  Database administration help  


Top Home  -  Register  -  Control Panel   -  Memberlist  -  Calendar  -  Faq  -  Search Top