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-11-2019, 08:03 AM   #1
Incanus
Incanus
Incanus doesn't litterIncanus doesn't litterIncanus doesn't litter
 
Incanus's Avatar
 
Posts: 275
Karma: 210
Join Date: Oct 2017
Location: Chile
Device: Boyue Likebook T80D
Question Regular Expression Request for Author Custom Field

Hello:

I'd like some help with regular expressions. I'm attempting to create two custom fields:
  1. Calibre's Authors field may contain many authors, but I need to create a "First Author" custom field with the first Author of the Authors field
  2. Having that, I need a custom field that gives me the initial letter of the "First Author"'s name (not the first letter of the "First Author" last name )

Awaiting your kind reply,

[INCANUS]

Last edited by Incanus; 03-11-2019 at 08:04 AM. Reason: Typo
Incanus is offline   Reply With Quote
Old 03-11-2019, 09:36 AM   #2
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 29,977
Karma: 56143930
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
While the sample shows Author_sort, it works with any text type field

Code:
 {authors[0]}
Note also, this depends on what sort/name rules you have applied (expects Fn Ln)
theducks is offline   Reply With Quote
Advert
Old 03-11-2019, 09:42 AM   #3
Incanus
Incanus
Incanus doesn't litterIncanus doesn't litterIncanus doesn't litter
 
Incanus's Avatar
 
Posts: 275
Karma: 210
Join Date: Oct 2017
Location: Chile
Device: Boyue Likebook T80D
Thumbs up

Quote:
Originally Posted by theducks View Post
Code:
 {authors[0]}
Note also, this depends on what sort/name rules you have applied (expects Fn Ln)
Thank you very much for your prompt and complete reply!

Now, I'm only missing the answer for #2 on my original post :-P

Very gratefully yours,

[INCANUS]
Incanus is offline   Reply With Quote
Old 03-11-2019, 10:57 AM   #4
Incanus
Incanus
Incanus doesn't litterIncanus doesn't litterIncanus doesn't litter
 
Incanus's Avatar
 
Posts: 275
Karma: 210
Join Date: Oct 2017
Location: Chile
Device: Boyue Likebook T80D
Exclamation Regular Expression Request for Author Custom Field

It would seem the answer for #2 is from the following post:

Quote:
Originally Posted by Sweetpea View Post
{#first_letter} is a compositie field: {author_sort:.1}
In my case, if

Code:
#first_author = {authors[0]}
Then

Code:
#first_author_letter = {#first_author:.1}
Can anyone please verify?

[INCANUS]

Last edited by Incanus; 03-11-2019 at 11:01 AM. Reason: Found possible solution in Calibre's Forum
Incanus is offline   Reply With Quote
Old 03-11-2019, 01:11 PM   #5
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 29,977
Karma: 56143930
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Quote:
Originally Posted by Incanus View Post
Thank you very much for your prompt and complete reply!

Now, I'm only missing the answer for #2 on my original post :-P

Very gratefully yours,

[INCANUS]
This only returns the first letter (and I think this is limited to the first Author)
My use was to create a folder by Authors Ln LETTER, to hod books by Author
Code:
 Authors_ {author_sort[0]}/{authors}-{title}
theducks is offline   Reply With Quote
Advert
Old 03-11-2019, 01:37 PM   #6
Incanus
Incanus
Incanus doesn't litterIncanus doesn't litterIncanus doesn't litter
 
Incanus's Avatar
 
Posts: 275
Karma: 210
Join Date: Oct 2017
Location: Chile
Device: Boyue Likebook T80D
Thanks for your input, I'll do some testing to check how it is actually working.

Gratefully,

[INCANUS]
Incanus is offline   Reply With Quote
Old 03-11-2019, 09:08 PM   #7
Incanus
Incanus
Incanus doesn't litterIncanus doesn't litterIncanus doesn't litter
 
Incanus's Avatar
 
Posts: 275
Karma: 210
Join Date: Oct 2017
Location: Chile
Device: Boyue Likebook T80D
Exclamation Regular Expression Request for Author Custom Field

After some experimentartion, this is what worked for me:

Code:
First Author = {author:sublist(0,1,&)}

First Letter of First Author = {author[0]}
So, to copy files to a disk or device using a related structure, it would go like this:

Code:
{author[0]}/{author:sublist(0,1,&)}/{title} - {author:sublist(0,1,&)}
Works like a charm!

Cheers,

[INCANUS]
Incanus is offline   Reply With Quote
Old 03-11-2019, 10:45 PM   #8
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 29,977
Karma: 56143930
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
theducks is offline   Reply With Quote
Reply

Tags
author, custom field, regular expression


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Have a Regular Expression problem with Author Field searcygr Library Management 2 09-21-2018 10:33 AM
Adding Books: regular expression request maxlinworm Library Management 1 02-17-2018 06:32 PM
Calibre book adding: Regular expression request... Tweetygirl10111 Calibre 13 07-13-2017 09:14 PM
Calibre book adding: Regular expression request... Spiffy Calibre 34 01-19-2016 01:03 PM
Regular expression: swap author firstname and lastname An_od Library Management 2 01-17-2013 10:55 AM


All times are GMT -4. The time now is 05:05 PM.


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