On 08/08/2018 09:50 AM, Paul Heinlein wrote:
On Wed, 8 Aug 2018, Richard Owlett wrote:

My bookmarks have grown like Topsy
I have many duplicates and the tree structure is a mess.
I have two primary goals:
  1. find and purge duplicates.
  2. move folders around to create a more reasonable structure.

After trying several approaches and looking for useful tools I found
jq [https://stedolan.github.io/jq/]. One related page I found is titled "jq is sed for JSON".

An outline of a possible procedure might be:
 1. Export SeaMonkey bookmarks in JSON format.
 2. use jq to pretty print the JSON. It does so nicely.
 3. Find duplicate targets and delete all but one.
 4. Each leaf of the bookmark tree is an object.
    Move these objects around to create a more friendly tree.
 5. Import the clean organized bookmarks.

Has anyone done this?
Is there a friendly in depth jq tutorial? The ones I've found tend to be on the "Hello world" level. There is just enough to tantalize.

jq is a great tool. I don't know if it by itself could find duplicates, but you could use its sort_by() routine in conjunction with uniq to do so.

I had seen those in my reading so assumed what I wanted was doable.


My understanding of jq's logic is limited, however, so I can't offer an example without knowing the exact format of the JSON you're seeing.

I suspect the only thing that can be said is that is syntactically correct.
It represents a tree structure and the duplicates may be at any depth.
That was what caused be for tutorial suggestions. The samples given were too simple structurally.


Another part of the problem is that I'm a bit more familiar with the implementation of JMESPath queries in AWS than in jq.



_______________________________________________
PLUG mailing list
[email protected]
http://lists.pdxlinux.org/mailman/listinfo/plug

Reply via email to