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 06-24-2015, 05:03 AM   #1
Phssthpok
Age improves with wine.
Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.
 
Posts: 558
Karma: 95229
Join Date: Nov 2014
Device: Kindle Oasis, Kobo Libra II
Regexp help for saving books

When saving books I specify the directory as {author_sort:re([.],)} to remove dots from the name, so that e.g. books by A.A. Milne are saved in "Milne, AA"

However, where there are multiple authors, I want only the first author, so I want to apply a second RE to remove everything after "&": something like {author_sort:re([.],):re(\&.*$,)}, but this is of course not valid.

What should I write to keep only the first author but with dots removed?
Phssthpok is offline   Reply With Quote
Old 06-24-2015, 07:26 AM   #2
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,734
Karma: 6690881
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Use Template Program Mode.

The template will look something like
Code:
{author_sort:'re(re($, '\&.*$', ''), '[.]', '')'}
I say "something like" because I haven't tested it.
chaley is offline   Reply With Quote
Advert
Old 06-24-2015, 11:04 AM   #3
Phssthpok
Age improves with wine.
Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.
 
Posts: 558
Karma: 95229
Join Date: Nov 2014
Device: Kindle Oasis, Kobo Libra II
Aha. Perfect, many thanks. I hadn't realised you could use "$" as the first argument for "re" -- where is this sort of thing documented?
Phssthpok is offline   Reply With Quote
Old 06-24-2015, 11:31 AM   #4
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,734
Karma: 6690881
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by Phssthpok View Post
Aha. Perfect, many thanks. I hadn't realised you could use "$" as the first argument for "re" -- where is this sort of thing documented?
In the link I gave you in my post.
chaley is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Help Please with saving books first last name JDS321 Calibre 8 05-14-2014 11:57 PM
saving books iomari Calibre 11 10-04-2011 10:34 AM
Regexp for series in books library noimporta Library Management 14 05-05-2011 08:20 AM
Saving after adding books KKneko7 Calibre 4 01-17-2011 09:55 PM
Problem with saving books alchemyst Calibre 3 08-19-2010 09:14 PM


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


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