Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Library Management

Notices

Reply
 
Thread Tools Search this Thread
Old 03-08-2024, 11:11 AM   #16
Comfy.n
want to learn what I want
Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.
 
Posts: 1,008
Karma: 6422750
Join Date: Sep 2020
Device: Calibre E-book viewer
Quote:
Originally Posted by kovidgoyal View Post
I highly doubt using a third party sqlite tool is going to work. This is text is FTS indexed and has various things going on that are not encapsulated in notes.db, for instance it links to resources not stored in the db file. Editing it directly will likely break something.
Yes, I've noticed that even editing a single database cell on DB Browser isn't accepted with notes.db. I get this message "Error changing data: no such tokenizer: calibre".

So exporting/ re-importing either as .sql or .csv won't work as well. I had also tried to copy the sql from the 'doc' column, manually editing the CSS bit on a text editor, and executing it, but I get a "finished with errors" message:

Execution finished with errors.
Result: unknown function: unixepoch()
At line 1:
INSERT INTO "main"."notes" ("doc") VALUES ('<div>
<p><img src="calres://xxh64/4e2f0cd .....

Last edited by Comfy.n; 03-08-2024 at 11:19 AM.
Comfy.n is online now   Reply With Quote
Old 03-08-2024, 11:48 AM   #17
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 11,742
Karma: 6997045
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
I can give you python templates that export and import every author note to some folder. You would run the templates in the template tester. You could also change them a bit to make them into Action Chains template code.

The folder name would be hard-coded in the template. I don't want to bother with opening a dialog.

You would export the notes then do what you want. The filename for the note would be something like "lookup_key#@#escaped_item_value#@#item_value_in_h ex.

The import template would process all the files in the folder, splitting the components apart. If the item value exists for the lookup key, it would import the note.

It will be this weekend before I can write the templates.
chaley is offline   Reply With Quote
Advert
Old 03-08-2024, 11:54 AM   #18
Comfy.n
want to learn what I want
Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.
 
Posts: 1,008
Karma: 6422750
Join Date: Sep 2020
Device: Calibre E-book viewer
Sounds perfect, thanks chaley. I hope I get along well with the template tester
Comfy.n is online now   Reply With Quote
Old 03-10-2024, 08:52 AM   #19
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 11,742
Karma: 6997045
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
I decided to do these as Action Chains actions because that is easier to use. Not easier to write, unfortunately, but that is neither here not there.

The attached zip contains two actions, Export notes and Import notes. Export notes asks you for the folder where it is to put the notes, then the field name (such as "authors") where it is to get the notes to export. It writes all the notes for that field into the folder with the file name
Code:
field_lookup_name#@#escaped_item_value#@#item_value_in_hex
Import note asks you to select the note files you wish to import, then does it. It gets the field lookup name from the filename.

I've tested them but that doesn't mean they will work for you. Please make a backup of your library before trying them. If something doesn't work, let me know. I'm not particularly interested in messing with the user interface or otherwise making it "cosmetically better".

Also, you will see that the HTML files include <head> ... </head> tags. Don't put anything in the head element because it is stripped away when the note is imported. If you want to style the note, do it with inline styles, in the head of the enclosing HTML document, or with <style> elements in the body. I haven't tried the last one but the 'net says it works in HTML5 browsers. Some say the browser might render the page twice, once without the styles and once with.
Attached Files
File Type: zip Export and import notes actions.zip (1.5 KB, 27 views)

Last edited by chaley; 03-10-2024 at 10:19 AM.
chaley is offline   Reply With Quote
Old 03-10-2024, 10:14 AM   #20
Comfy.n
want to learn what I want
Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.
 
Posts: 1,008
Karma: 6422750
Join Date: Sep 2020
Device: Calibre E-book viewer
Can't thank you enough, chaley. It works perfectly, both the export and the import.
Phew! I'm so glad I won't need to run again 1500+ author data retrieval again just to get the desired styling on the book details pane.

Comfy.n is online now   Reply With Quote
Advert
Old 03-10-2024, 10:31 AM   #21
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 11,742
Karma: 6997045
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Thanks for confirming that it works for you.

I added post #19 above to the Action Chains Resources thread

Last edited by chaley; 03-11-2024 at 02:39 PM. Reason: Fix broken cross-linking
chaley is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Bulk Tag Editing (Bulk-adding Prefixes for Heirarchical Tags) Jackwc Library Management 3 01-14-2024 05:24 PM
Bulk Editing Comments ilovejedd Library Management 3 01-14-2018 07:23 PM
Bulk metadata editing paoletto Library Management 7 10-29-2014 12:42 PM
Editing Metadata in Bulk ballast Calibre 5 08-15-2010 03:14 PM
Editing Metadata in Bulk Question lwpack Calibre 10 07-19-2009 11:40 PM


All times are GMT -4. The time now is 06:15 AM.


MobileRead.com is a privately owned, operated and funded community.