Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Software > Calibre > Library Management

Notices

Reply
 
Thread Tools Search this Thread
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
Old 10-04-2011, 10:55 AM   #2
Starson17
Wizard
Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.
 
Posts: 4,004
Karma: 177841
Join Date: Dec 2009
Device: WinMo: IPAQ; Android: HTC HD2, Archos 7o; Java:Gravity T
Quote:
Originally Posted by PeterSm View Post
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
AFAIK, you can't do this. The fields (Author, Title, etc.) come from either the file metadata, or the filename/regex. If you're using regex, you have to have a match between some part of the filename and the regex. If the "hardcoded values" aren't already in the filename, then the regex can't match them, and they can't be part of the imported field.

I've occasionally wanted this, too. I usually just use Search and Replace to do it after import.
Starson17 is offline   Reply With Quote
Advert
Reply

Tags
import to calibre, regexp

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Regex: File Renaming Pre-Import & Importing penguinaka Library Management 20 08-14-2012 06:11 PM
Regex Question involving multiple . (periods) hanbalfrek Conversion 11 08-29-2011 05:06 PM
Regex question and maybe some help crutledge Sigil 9 03-10-2011 04:37 PM
Regex Question Archon Conversion 11 02-05-2011 10:13 AM
Import files, regex question al35 Calibre 0 03-22-2010 12:33 PM


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


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