Sorting inside HTML files?

  • Thread starter Thread starter Terry Pinnell
  • Start date Start date
T

Terry Pinnell

I want to find some program that will help me sort specific tagged
items within an HTML file. For example, editing a file called
MyBookmarks.htm so that the bookmarks were in alphabetical order.

Anyone know of anything like that please?
 
I think that you need a JS routine to sort the rows of a table.

I once needed something like that, and I used
http://kryogenix.org/code/browser/sorttable/ as a starting point. But
you'll need to adapt it to your exact needs.

Regards,
Thanks Marco. Happily I managed to do it myself. Just as well, as I
don't know JavaScript <g>.

In case it helps anyone else with a similar requirement, here are a
few notes. My particular one-off requirement was to sort about 80
place names inside a file. I managed to do it relatively easily in my
text editor, TextPad, with a little use of Regex. Essentially I
converted each entry from its original 10-15 lines of tags and code to
a single line. The NAME was luckily in a fixed position on the line
and so could be sorted by TextPad. The messiest part was confining the
editing to just the section of file containing these names, and
keeping the rest unchanged.

I wouldn't like to have to do this regularly though, and more complex
structures wouldn't allow it anyway. So still keen to hear of any
suitable tools please.
 
Terry Pinnell said:
I want to find some program that will help me sort specific tagged
items within an HTML file. For example, editing a file called
MyBookmarks.htm so that the bookmarks were in alphabetical order.

Anyone know of anything like that please?

I recently encountered this problem, and solved it by using CSVed
http://home.hccnet.nl/s.j.francke/t2t/text2table.htm
Method:
(1) Extract list of links from the source page.
(2) Example: <LI><A HREF="http://www.url.com/">Sitename</A> -
(3) Replace all occurrences of "> with ,">
(4) instead of a comma as separator you can use something else such as ¶
(5) Save list as Something.csv (comma separated value).
(6) Load into CSVed
(7) Sort second column (See Tools > Options)
(8) Save the file as a text file and reverse (3)
(9) Replace the list in the HTML file.

It's easier to do than to describe!!!!
There may be an easier way, but this way works for me.

===

Frank Bohan
¶ Lawyers are the larval stage of politicians.
 
Frank Bohan said:
I recently encountered this problem, and solved it by using CSVed
http://home.hccnet.nl/s.j.francke/t2t/text2table.htm
Method:
(1) Extract list of links from the source page.
(2) Example: <LI><A HREF="http://www.url.com/">Sitename</A> -
(3) Replace all occurrences of "> with ,">
(4) instead of a comma as separator you can use something else such as ¶
(5) Save list as Something.csv (comma separated value).
(6) Load into CSVed
(7) Sort second column (See Tools > Options)
(8) Save the file as a text file and reverse (3)
(9) Replace the list in the HTML file.

It's easier to do than to describe!!!!
There may be an easier way, but this way works for me.

Thanks, Frank. I'll try it, but my method sounds a bit simpler!
 
Back
Top