Register Guidelines E-Books Search Today's Posts Mark Forums Read

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

Notices

Reply
 
Thread Tools Search this Thread
Old 09-03-2023, 08:00 PM   #46
shinykari
Member
shinykari doesn't littershinykari doesn't litter
 
Posts: 19
Karma: 128
Join Date: Jan 2020
Device: Kobo Libre2
Is there a way to pull a "Name" formatted column into a Column, Built from Other Columns (Behaves like tags)?

My #koboshelves composite column template is

Quote:
{#fandom},{#characters},{#pairing}
It pulls in the #fandom and #pairing data, but the #characters data, which is in a column that's formatted as "Ampersand formatted text, show in tags browser" and as "Names," doesn't populate.

Right now I created a work around by using Action Chains to manually copy the info from the #characters column into a new plain "Comma separated text" column and pulling THAT into the #koboshelves column, but I'd like to remove that extra step if possible.

ETA: And another question! Is there an easy way (preferably using mass edit/search & replace) to take information from the #pairing column (formatted as Character A/Character B) and copy that into a #characters column as Character A & Character B?

Last edited by shinykari; 09-03-2023 at 08:04 PM.
shinykari is offline   Reply With Quote
Old 09-04-2023, 05:33 AM   #47
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,846
Karma: 7035877
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by shinykari View Post
Is there a way to pull a "Name" formatted column into a Column, Built from Other Columns (Behaves like tags)?

My #koboshelves composite column template is



It pulls in the #fandom and #pairing data, but the #characters data, which is in a column that's formatted as "Ampersand formatted text, show in tags browser" and as "Names," doesn't populate.
It works fine for me.

Here is my column definition for the column like your #characters.
Click image for larger version

Name:	Clipboard01.png
Views:	140
Size:	13.3 KB
ID:	203539

Here is the template for my composite column
Click image for larger version

Name:	Clipboard02.png
Views:	148
Size:	28.1 KB
ID:	203540

Here is the result, shown in the book list.
Click image for larger version

Name:	Clipboard05.png
Views:	135
Size:	4.4 KB
ID:	203542

Do note that there can be problems copying data from a 'contains names' column (& separated) to a 'like tags' column (comma separated). If a name contains a comma than it is considered 2 tags. If this is possible then you should use re() to convert the commas into something else, perhaps a semicolon.

Also note that the tags in "like tags" composites are sorted. The order won't be the implied order in the template.
Quote:
Right now I created a work around by using Action Chains to manually copy the info from the #characters column into a new plain "Comma separated text" column and pulling THAT into the #koboshelves column, but I'd like to remove that extra step if possible.

ETA: And another question! Is there an easy way (preferably using mass edit/search & replace) to take information from the #pairing column (formatted as Character A/Character B) and copy that into a #characters column as Character A & Character B?
Yes, using search & replace in regexp mode. Something like this:
Click image for larger version

Name:	Clipboard07.png
Views:	140
Size:	44.9 KB
ID:	203544

Here is the booklist before running the S&R
Click image for larger version

Name:	Clipboard06.png
Views:	142
Size:	2.6 KB
ID:	203543

And after running the S&R
Click image for larger version

Name:	Clipboard08.png
Views:	124
Size:	2.2 KB
ID:	203545
chaley is offline   Reply With Quote
Advert
Old 09-04-2023, 10:51 AM   #48
shinykari
Member
shinykari doesn't littershinykari doesn't litter
 
Posts: 19
Karma: 128
Join Date: Jan 2020
Device: Kobo Libre2
Quote:
Originally Posted by chaley View Post
Do note that there can be problems copying data from a 'contains names' column (& separated) to a 'like tags' column (comma separated). If a name contains a comma than it is considered 2 tags. If this is possible then you should use re() to convert the commas into something else, perhaps a semicolon.

Also note that the tags in "like tags" composites are sorted. The order won't be the implied order in the template.
Ah, yes, that may be the problem. The destination column is a "like tags" column. I will play with it and see if replacing "&" with another type of punctuation will allow it to work as intended. Sort order doesn't matter here.

Quote:
Originally Posted by chaley View Post
Yes, using search & replace in regexp mode. Something like this:
Thank you! I will give this a try.
shinykari is offline   Reply With Quote
Old 09-04-2023, 11:39 AM   #49
shinykari
Member
shinykari doesn't littershinykari doesn't litter
 
Posts: 19
Karma: 128
Join Date: Jan 2020
Device: Kobo Libre2
@chaley This worked!!!

For those who are interested in doing something similar, here's the details:

For the Pairing to Characters conversion, I set up an Action Chain exactly as chaley said, so I could run it on the books currently in my library. (New books imported will automatically populate #characters based on that field in FanFicFare.) The #characters column is a Comma Separated Text, like tags, shown in Tag Browser, with the "Names" option checked.

For my #koboshelves column, I set up a custom column as a "Column built from other columns, behaves like tags" with the following template:

Code:
{#fandom},{#pairing},{#characters:re(&, \,)}
This does end up with a bit of clean up work to merge all the "Character (implied)" and "Character (past)" into "Character", but it's worth it!
shinykari is offline   Reply With Quote
Old 09-05-2023, 02:06 PM   #50
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,846
Karma: 7035877
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by un_pogaz View Post
EDIT: And as expected, the Regular search syntax is faster than the Template search. A little, but perceptible (that with I search for this version).
I strongly suspect that in this case a template search that uses a python template will be faster than the regular search, as long as there aren't any search terms other than the template search. The python template will be pre-compiled then run for each book at python speed instead of GPM speed.
chaley is offline   Reply With Quote
Advert
Old 09-14-2023, 12:17 PM   #51
kjdavies
Zealot
kjdavies is no e-book dilettante.kjdavies is no e-book dilettante.kjdavies is no e-book dilettante.kjdavies is no e-book dilettante.kjdavies is no e-book dilettante.kjdavies is no e-book dilettante.kjdavies is no e-book dilettante.kjdavies is no e-book dilettante.kjdavies is no e-book dilettante.kjdavies is no e-book dilettante.kjdavies is no e-book dilettante.
 
Posts: 111
Karma: 53342
Join Date: Jun 2013
Device: Sony PRS-600
Quote:
Originally Posted by ownedbycats View Post
For this specific case, I have a column, #readdates, which stores multiple dates, and a composite column to sort them.

Is there a better way to store multiple dates? In a regular tag column, 'Aug 12 2023' sorts alphabetically.
If you make it a tag column (comma-separated values), format the dates 'YYYY.MM.DD', they will sort in order and can be rendered hierarchically. That is, if you look at the title's details it might render 2023.08.26, 2023.08.27, 2023.08.28, 2023.09.10, 2023.09.11, 2023.09.12... but in the tag browser, this entry would show up under
  • 2023
    • 08
      • 26
      • 27
      • 28
    • 09
      • 10
      • 11
      • 12

I've used this format a few times in a library that tracks when a title went into the store, when it was last updated, when I bought it, when I last downloaded it. It's actually not treated as a date, it's just a specifically-formatted string.

If they are date fields, you can create a custom column with a template to convert the date to the format above. However, I found (in the version I tried this with) that did some unfortunate things to GUI performance. I instead made it a static string and then updated my scripts to populate both the date fields and the formatted date fields.
kjdavies is offline   Reply With Quote
Old 09-17-2023, 07:07 AM   #52
Wiggo
Leftutti
Wiggo ought to be getting tired of karma fortunes by now.Wiggo ought to be getting tired of karma fortunes by now.Wiggo ought to be getting tired of karma fortunes by now.Wiggo ought to be getting tired of karma fortunes by now.Wiggo ought to be getting tired of karma fortunes by now.Wiggo ought to be getting tired of karma fortunes by now.Wiggo ought to be getting tired of karma fortunes by now.Wiggo ought to be getting tired of karma fortunes by now.Wiggo ought to be getting tired of karma fortunes by now.Wiggo ought to be getting tired of karma fortunes by now.Wiggo ought to be getting tired of karma fortunes by now.
 
Wiggo's Avatar
 
Posts: 415
Karma: 1153449
Join Date: Feb 2019
Location: Bavaria
Device: iPad Pro, Kobo Libra 2
What a happy coincidence!

I just saw @chaley's post in the template language changes thread https://www.mobileread.com/forums/sh...&postcount=124 and thought of the problem I've been having for a few days.

How can I bulk add my #dateread entries to a comma separated tag like column in the format yyyy.mm.dd? Some books already have entries, some do not.

edit: I just saw it's something similar @kjdavies is talking about

Last edited by Wiggo; 09-17-2023 at 07:12 AM.
Wiggo is offline   Reply With Quote
Old 09-17-2023, 07:17 AM   #53
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,846
Karma: 7035877
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by Wiggo View Post
What a happy coincidence!

I just saw @chaley's post in the template language changes thread https://www.mobileread.com/forums/sh...&postcount=124 and thought of the problem I've been having for a few days.

How can I bulk add my #dateread entries to a comma separated tag like column in the format yyyy.mm.dd? Some books already have entries, some do not.

edit: I just saw it's something similar @kjdavies is talking about
If I understand you, you want to format the date in #dateread and add it to a custom tags-like column. Why is it tags-like? How many #dateread columns do you have in each book? What do you expect to happen if you change the value in #dateread?
chaley is offline   Reply With Quote
Old 09-17-2023, 07:21 AM   #54
ownedbycats
Custom User Title
ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.
 
ownedbycats's Avatar
 
Posts: 8,953
Karma: 62040409
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
Quote:
Originally Posted by chaley View Post
If I understand you, you want to format the date in #dateread and add it to a custom tags-like column. Why is it tags-like? How many #dateread columns do you have in each book? What do you expect to happen if you change the value in #dateread?
I have a taglike column for dates myself. When I finish a book, I copy the #lastread to the tag-column with a template. (This is part of my mark-as-read action chain. It also increments #timesread and has me set a rating.)

This lets me store multiple read dates but with only two columns, a date and a taglike.

Last edited by ownedbycats; 09-17-2023 at 07:28 AM.
ownedbycats is offline   Reply With Quote
Old 09-17-2023, 07:32 AM   #55
Wiggo
Leftutti
Wiggo ought to be getting tired of karma fortunes by now.Wiggo ought to be getting tired of karma fortunes by now.Wiggo ought to be getting tired of karma fortunes by now.Wiggo ought to be getting tired of karma fortunes by now.Wiggo ought to be getting tired of karma fortunes by now.Wiggo ought to be getting tired of karma fortunes by now.Wiggo ought to be getting tired of karma fortunes by now.Wiggo ought to be getting tired of karma fortunes by now.Wiggo ought to be getting tired of karma fortunes by now.Wiggo ought to be getting tired of karma fortunes by now.Wiggo ought to be getting tired of karma fortunes by now.
 
Wiggo's Avatar
 
Posts: 415
Karma: 1153449
Join Date: Feb 2019
Location: Bavaria
Device: iPad Pro, Kobo Libra 2
Quote:
Originally Posted by chaley View Post
If I understand you, you want to format the date in #dateread and add it to a custom tags-like column. Why is it tags-like? How many #dateread columns do you have in each book? What do you expect to happen if you change the value in #dateread?
I got the idea with the two columns from@obc (as described above).

But I want my "date-tags" hierarchical - yyyy.mm.dd
So e.g. a book has the #readdates 2016.12.01, 2023.09.17

But I can't manage to add the last dateread (instead of replace) and make it hierarchical

edit: @obc
how do you do incrementig the readcount, I'm also to stupid for?

Last edited by Wiggo; 09-17-2023 at 07:35 AM.
Wiggo is offline   Reply With Quote
Old 09-17-2023, 07:43 AM   #56
ownedbycats
Custom User Title
ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.
 
ownedbycats's Avatar
 
Posts: 8,953
Karma: 62040409
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
I think something like this in an Action Chains SFE should work - I'm not on source and can't test at the moment. Run it in the tester first.

Code:
program:
	list_union(strcat(format_date_field('#lastread', 'yyyy.MM.dd')), $#readdates, ',')
It's based on the template I use. lastread is your date column, and readdates is your tag column. Set readdates to hierarchical in settings.

Last edited by ownedbycats; 09-17-2023 at 07:48 AM. Reason: forgot some aporstrophes
ownedbycats is offline   Reply With Quote
Old 09-17-2023, 09:21 AM   #57
Wiggo
Leftutti
Wiggo ought to be getting tired of karma fortunes by now.Wiggo ought to be getting tired of karma fortunes by now.Wiggo ought to be getting tired of karma fortunes by now.Wiggo ought to be getting tired of karma fortunes by now.Wiggo ought to be getting tired of karma fortunes by now.Wiggo ought to be getting tired of karma fortunes by now.Wiggo ought to be getting tired of karma fortunes by now.Wiggo ought to be getting tired of karma fortunes by now.Wiggo ought to be getting tired of karma fortunes by now.Wiggo ought to be getting tired of karma fortunes by now.Wiggo ought to be getting tired of karma fortunes by now.
 
Wiggo's Avatar
 
Posts: 415
Karma: 1153449
Join Date: Feb 2019
Location: Bavaria
Device: iPad Pro, Kobo Libra 2
Thanks for this code @obc - I wait for the Calibre update to test it.

I'm very interested in your mark-as-read action chain, would you attach it here, please?
Wiggo is offline   Reply With Quote
Old 09-17-2023, 09:41 AM   #58
ownedbycats
Custom User Title
ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.
 
ownedbycats's Avatar
 
Posts: 8,953
Karma: 62040409
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
Quote:
Originally Posted by Wiggo View Post
Thanks for this code @obc - I wait for the Calibre update to test it.

I'm very interested in your mark-as-read action chain, would you attach it here, please?
Here. Since a lot of the options overlap, I use Chain Variations to also have it serve as a 'Mark as DNF' chain. Note the comments.

Click image for larger version

Name:	2023-09-17 10_41_09-Add actions.png
Views:	221
Size:	37.3 KB
ID:	203812
Attached Files
File Type: zip MarkAsReadDNF.zip (2.3 KB, 148 views)
ownedbycats is offline   Reply With Quote
Old 09-17-2023, 09:44 AM   #59
Wiggo
Leftutti
Wiggo ought to be getting tired of karma fortunes by now.Wiggo ought to be getting tired of karma fortunes by now.Wiggo ought to be getting tired of karma fortunes by now.Wiggo ought to be getting tired of karma fortunes by now.Wiggo ought to be getting tired of karma fortunes by now.Wiggo ought to be getting tired of karma fortunes by now.Wiggo ought to be getting tired of karma fortunes by now.Wiggo ought to be getting tired of karma fortunes by now.Wiggo ought to be getting tired of karma fortunes by now.Wiggo ought to be getting tired of karma fortunes by now.Wiggo ought to be getting tired of karma fortunes by now.
 
Wiggo's Avatar
 
Posts: 415
Karma: 1153449
Join Date: Feb 2019
Location: Bavaria
Device: iPad Pro, Kobo Libra 2
Quote:
Originally Posted by ownedbycats View Post
Here. Since a lot of the options overlap, I use Chain Variations to also have it serve as a 'Mark as DNF' chain. Note the comments.

Attachment 203812


I‘m looking forward for testing it.
Wiggo is offline   Reply With Quote
Old 09-17-2023, 09:49 AM   #60
ownedbycats
Custom User Title
ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.
 
ownedbycats's Avatar
 
Posts: 8,953
Karma: 62040409
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
Quote:
Originally Posted by ownedbycats View Post
Here. Since a lot of the options overlap, I use Chain Variations to also have it serve as a 'Mark as DNF' chain. Note the comments.

Attachment 203812
Templates used. You may need to adjust things.

Set #lastread. (If you don't use Kobo Utilities, you can just replace this with a predefined value for current datetime.)


Code:
program:
	
## Check Kobo status column. If it's empty, set to current datetime.
	if $#kobostatus=='' then format_date(today(),'iso')
## If kobostatus is populated, date imports from Kobo Utilities - don't overwrite!
	else $$#lastread
	fi

Add dnf to admintags:

Code:
program: list_union($#admintags, 'dnf', ',')
Increment #timesread:

Code:
program: $$#timesread + 1
Add dates to #readdates:

Code:
program:
	list_union(strcat(format_date($$#lastread, 'MMM d yyyy')), $#readdates, ',')
The other SFEs are either predefined or ask-on-runtime.

Last edited by ownedbycats; 09-17-2023 at 09:52 AM.
ownedbycats is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Templates: various questions not worth their own thread ownedbycats Library Management 692 07-11-2024 05:25 PM
Forma Questions about quick management of Collections. droopy Kobo Reader 5 10-10-2019 11:34 PM
2 questions; library management & calibre version Blue2u Library Management 4 04-15-2018 07:53 PM
eBook/Comic/Manga Library Management Workflow: How do you manage your library? Inukami Library Management 16 08-02-2017 12:24 PM
Thread management questions meme Feedback 6 01-31-2011 05:07 PM


All times are GMT -4. The time now is 11:14 AM.


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