View Single Post
Old 10-03-2011, 06:23 PM   #1
PeterSm
Member
PeterSm began at the beginning.
 
Posts: 15
Karma: 10
Join Date: Oct 2011
Location: London England
Device: Kindle 4 non touch,paperwhite 10
Question Newbie question - Hardcode values on RegEx on import

Hi,
sorry if this is a real newbie question but I have had a look around and cant really locate anything suitable (though happy to be redirected if I've missed something..)

I'm using Calibre 8.21 and have installed the Quick Preferences plugin as it has the ability to setup and maintain multiple import rules to rework the settings

I'm after trying to set up a rule which would allow me to have hardcoded values passed in and then these added to the values inside Calibre so when I convert its setup as I'd like them..

So what I'm after is the ability to take file "a kindle book.mobi" but when its imported the

title becomes AAxx - A Kindle Book

and

the Author becomes NewAuthor

Be great if I could then add AA as the series and xx as the number (but just getting me started is appreciated!)

so when I convert I end up with a file/metadata/calibre entry
"AAxx - A Kindle Book - NewAuthor.mobi"
(Serries AA, number xx)

working example
filename = 20000 Leagues under the sea.mobi
my version = JV01 - 2000 Leagues Under The Sea - Jules Verne.mobi
where I amend script to pass in JVxx and Jules Verne

Still getting the hand of reg Expressions but assume its something similar to

(?P<series>\JV\) - (?P<series_index>\01\)( - (?P<title>+)( - (?P<author>\Jules Verne\.+)

(*but this is probably wrong!! but hopefully you'll get my drift...)

I don't then mind occasionally amending/building new rules as and when I do a bulk import

I've tried escaping the text using the \AAxx - \ codes but can't seem to get it to work so any advice/redirection elsewhere greatfully accepted..

Regards and Thanks
PeterSm.
PeterSm is offline   Reply With Quote