lynx-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: LYNX-DEV sorting bookmark


From: Filip M Gieszczykiewicz
Subject: Re: LYNX-DEV sorting bookmark
Date: Wed, 16 Jul 1997 11:57:35 -0500 (CDT)

You (Philip Webb) wrote:
> 970715 J V Estacio de Souza wrote: 
> > Is there some function in lynx to sort alphabeticaly my bookmark?
> 
> no: the bookmark file is a special delicate instrument
> which can be altered only in a few very simple ways.
> to re-order entries,
> use a text editor to move whole lines to where you want them.
> you can also edit the URL or the title of the site,
> but don't do anything else.

Greetings. Really? I sort them using some simply unix tools all the time:

Assuming original bookmark file is called "bookmarks.html"

1) Copy "bookmarks.html" to "body.html" and "header.html"
1a) Edit "body.html" and remove everything up to and including the "<ol>"
1b) Edit "header.html" and remove everything AFTER "<ol>"
2) Run the following line on the "body.html" file and APPEND to "header.html":

cat body.html | sed s'@>@>\% @g' | sort +3 | sed s'@>\% @>@g' >> header.html

3) File "header.html" now contains the sorted bookmarks. Test it with lynx
EVERY TIME (just in case). I'd compress and save the old "bookmarks.html" file!

(the sed is necessary to ensure that there is a space after EACH ">" in the
bookmarks file so that the sort command can pick which field to sort on - in
this case, the "title" of the link. The second sed removes the space.)

YMMV :-)

I just tested that with a 22K Refereces.html:

-rwx------   1 filipg   user        21956 Jul 14 21:06 References.html*
-rwx------   1 filipg   user        21956 Jul 16 11:48 header.html*

Nothing lost... plenty gained. NOTE: you will loose the hierarchy the site
used and you saved in the original bookmarks file. Example:

PBS Home page
News
Sports

will sort to:

News
PBS Home page
Sports

You can play with the flags to "sort" to sort numbers, ignore spaces or case,
etc.

Take care.
;
; To UNSUBSCRIBE:  Send a mail message to address@hidden
;                  with "unsubscribe lynx-dev" (without the
;                  quotation marks) on a line by itself.
;

reply via email to

[Prev in Thread] Current Thread [Next in Thread]