Quantcast
Channel: MobileRead Forums - Reading and Management
Viewing all articles
Browse latest Browse all 23783

NEED HELP! Template to SHORTEN SERIES NAME

$
0
0
Hi - I need help to shorten the series name using a template/plugboard!

I want to create a custom column using the following book title - but I am having trouble shortening the series name:
(essentially, I want to use (approx) the first 2 words of the series name)
[SHORTENED SERIES NAME] - series index# - book title

I want to shorten the series name in a particular way - basically it would require 2 steps:
a) I want to strip off the first word (if it is an article - a/an/the)
I can do this with a custom column/using template syntax:
#stripped_series. Template: {series:re(^(A|The|An)\s+,)||}

b) then I want to use the first 2 words (approx) of the series name
BUT THIS IS WHERE I GET STUCK...

I want to use the first 2 words of the series name BUT if the following words appear, they should be included but not counted as one of the '2' words:
any article (a/an/the), conjunction (and/or/&), preposition (of, from..etc), AND any word ending in '.' (full stop) ie any short form like Mr., St. etc.

EXAMPLES:
1) Lord of the Rings and other Tolkien Stories WOULD APPEAR AS
Lord of the Rings
2) Kincaid & James WOULD APPEAR AS Kincaid & James
3) Mr.Fox & Mrs.Chicken mysteries WOULD APPEAR AS Mr. Fox & Mrs. Chicken
4) D.I. Helen Grace series WOULD APPEAR AS D.I.Helen Grace

Can anyone help me with a template that will perform STEP B? (I tried using python syntax strip.string_variable to no avail...I'm just stumped)....

Thanks so much....
PERSISTENCE

Viewing all articles
Browse latest Browse all 23783

Trending Articles