12-16-2011, 11:37 AM | #1 |
Enthusiast
Posts: 26
Karma: 10
Join Date: Oct 2010
Device: Samsung SM-T290
|
Filename plugboard
I've got this:
{#stripped_title:re(([a-z]+|[A-Z]+|[0-9]+)\s+,)||} And it works but it's SO not giving me what I want. It strips all but the last word or two of the title and includes apostrophes and commas, strips any trailing "s". Arg. This is entirely because I don't know exactly what I'm doing. I program but the regex I'm used to using isn't Python and I'm having trouble making the mental switch-over. I've got a stripped title that works great and I use this field in a number of places. {title:re(^(A|The|An)\s+,)||} With a \s+ (why is the "s" being escaped? Not a clue) and a comma. No clue what that's for either. What I want is a the title with no spaces or punctuation. That's all. Can someone help? Thanks. Nori |
12-16-2011, 02:06 PM | #2 | |
Well trained by Cats
Posts: 29,803
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
Quote:
Isn't comma space more common? |
|
12-19-2011, 02:35 AM | #3 |
Wizard
Posts: 3,130
Karma: 91256
Join Date: Feb 2008
Location: Germany
Device: Cybook Gen3
|
|
12-19-2011, 10:55 AM | #4 |
Well trained by Cats
Posts: 29,803
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
|
12-23-2011, 08:57 AM | #5 |
Enthusiast
Posts: 26
Karma: 10
Join Date: Oct 2010
Device: Samsung SM-T290
|
So, how do I do it? I'm trying to create a file name that's the initials of the author(s) (I can do that), the initials of the series (ditto here) and the first 18 or 20 characters of the title minus any spaces and punctuation. ?
|
12-23-2011, 12:20 PM | #6 | |
Grand Sorcerer
Posts: 11,741
Karma: 6997045
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
Code:
{title:'shorten(re($, '\W', ''), 18, '', 0)'} |
|
12-30-2011, 09:29 AM | #7 |
Enthusiast
Posts: 26
Karma: 10
Join Date: Oct 2010
Device: Samsung SM-T290
|
I didn't do it the way you described but I got it done. I'm getting this, it's just really slow. I'm a bit of a one trick pony. I learn one way to do things and it's a struggle to integrate other ways of doing it . . . but only at the beginning.
Nesting stuff, which is what you've done with the shorten and the replace, is awesome. I'm going to keep referring back to this. Thanks. Nori |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Metadata Plugboard | IxiaAurea | Calibre | 1 | 11-05-2011 01:13 PM |
Plugboard doesn't appear to take effect | PerspexAvenger | Calibre | 1 | 06-07-2011 04:03 AM |
Plugboard Question | gweminence | Calibre | 3 | 01-11-2011 01:34 PM |
K3 plugboard basics | jackie999 | Calibre | 13 | 12-13-2010 03:48 AM |
Problem with Metadata Plugboard | cheveguerra | Calibre | 3 | 10-05-2010 12:00 PM |