JRS: In article <Gd**************@pigsonthewing.org.uk>, dated Sun, 27
Aug 2006 12:05:54 remote, seen in news:comp.infosystems.
www.authoring.html,
Andy Mabbett <us**********@pigsonthewing.org.ukposted :
>
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?
Much depends on whether the layout of the source is consistent. If all
columns of a row are in a single source line, no problem; if they're
split in a consistent manner, no great problem; if the table code is
wrapped like a paragraph of text without regard to its HTML structure,
then why not fix that first? ISTM MiniTrue will do it.
For the first case, start with something like (partly tested) :
mtr -x+ u*.htm "(.*<\/td>)(.*<\/td>)(.*<\/td>)(.*<\/td>)(.*<\/td>)" = \1\2\3\5\4
AFTER reading mtr -h & mtr -? completely.
NOTE that to involve \1 in the reordering a change may be needed; consider
mtr -x+ u*.htm "(<td>.*)(<td>.*)(<td>.*)(<td>.*)(<td>.*)" = \2\3\1\4\5
--
© John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Turnpike v4.00 MIME. ©
Web <URL:http://www.merlyn.demon.co.uk/- FAQish topics, acronyms, & links.
I find MiniTrue useful for viewing/searching/altering files, at a DOS prompt;
free, DOS/Win/UNIX, <URL:http://www.idiotsdelight.net/minitrue/>