On 08/18/2018 04:50 AM, Daniel wrote:
Richard Owlett wrote on 18/08/2018 1:44 PM:
[snip]
Have made progress :]
BUT creating useful output in JSON format acceptable to SeaMonkey unlikely :[

Boo! Hiss!!

Sorry about that <snicker>
Have you looked at a JSON file even after pretty printing with "jq"?


HOWEVER I expect I'll be able to create a HTML file which can serve nicely as bookmarks. That was one of my initial alternative goals.

SeaMonkey used to, natively, I think, do this!!

Yes, Bookmarks->Manage Bookmarks then, in the Bookmark Manager, Tools->Export HTML....

Yes, *BUT*!!!!!
The way they chose to display the HTML hides much of the hierarchical stucture of nested bookmarks. Whether or not I delete a specific URL reference depends on where it is in the structure. I have some intentional duplications.


My path to that will depend on Linux tools. I suspect similar tools exist in Windows. I will be creating a description of my combination of scripts and manual edits.

I suspect that this could be done in jq with an expert's skill set.

My goals include:
  1. Create a HTML file with hierarchy *CLEARLY* visible.
  2. Create a text file of duplicated URLs and how many times
     each appears.
  3. Create a tool to ease removal of duplicates from *MY* HTML.
  4. I might possibly perhaps investigate creating an HTML file
     SeaMonkey could import. Enough qualifiers there??

My _preliminary_ TCL [not quite pre-alpha] is:
# Input is SeaMonkey bookmark file pretty printed with "jq '.' ..."
set infile  "pretty_json.txt"
# the format of "useful.txt" not yet defined
set outfile "useful.txt"
set fd_in  [open $infile  r]
set fd_out [open $outfile w]

set children   "\"child"
set uri        "\"uri\":"
set title      "\"title"
set rbracket   \]
set mylist [list $children  $uri  $title $rbracket]

while { ! [eof $fd_in] } {
gets $fd_in b_line set a_line [string trimleft $b_line] set c_line [string range $a_line 0 5]
      set x  [lsearch $mylist $c_line]
      switch $x {
          1 {procedure1}
          2 {procedure2}
          3 {procedure3}
          4 {procedure4}
          }
}

close $fd_in
close $fd_out

_______________________________________________
support-seamonkey mailing list
[email protected]
https://lists.mozilla.org/listinfo/support-seamonkey

Reply via email to