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 12-25-2015, 09:09 AM   #1
yonkyunior
Cultivator
yonkyunior doesn't litteryonkyunior doesn't litteryonkyunior doesn't litter
 
yonkyunior's Avatar
 
Posts: 94
Karma: 216
Join Date: Feb 2015
Device: PRST2
Thumbs down Pre-Import ebook with Filenames to custom column?

I use using filename import without read the metadata with calibre to speed up the process of adding new ebook.

I have very little knowledge about REGEX,
and i have to learn it a bit to use calibre, just the basic one, like
for example
i understand title that have () or [] will be stripped with this regex:
Code:
(?P<title>[^\]{[()]+\w)
or using ? for optional regex
but for using to build my own patttern in calibre i dont get it right,
so i just grab other people regex pre-importing pattern and modified that.

for example:
before i use the regex
it doesnt work fine when i tested with, with little modification it works.
Code:
(?P<title>[a-zA-Z1-9 ]+)(\(.*\))?$
i dont know why, i dont understand much more

The Regex i used i got from this site,
i have to test it before i used it, so this one i used.


FOR:
Catherine Asaro - Primary Inversion (v5.0) (epub).epub
Catherine Asaro - [Skolian Empire 01] - Primary Inversion (v5.0) (epub).epub
Catherine Asaro - Skolian Empire 01 - Primary Inversion (v5.0) (epub).epub

REGEX :
Code:
^((?P<author>([^\-_0-9]+)(?=\s*-\s*)(?!\s*-\s*[0-9.]+)|\b))(\s*-\s*)?(\[?(?P<series>[^0-9\-]+) (- )?(?P<series_index>[0-9.]+)\]?\s*-\s*)?(?P<title>[^\]{[()]+\w)
The Problem is if there is striplines in series in will broke,
like this..

Catherine Asaro - [Skolian Empire 10 - Triad 01] - Schism (v5.0) (epub).epub

so i make one again with quick preference plugins, that points out the series to grab anything.

Before (?P<series>[^0-9\-]+)
After (?P<series>.+)

Code:
^((?P<author>([^\-_0-9]+)(?=\s*-\s*)(?!\s*-\s*[0-9.]+)|\b))(\s*-\s*)?(\[?(?P<series>.+) (- )?(?P<series_index>[0-9.]+)\]?\s*-\s*)?(?P<title>[^\]{[()]+\w)
It just works, but sometimes when i got 10 or more it will fail for some but others just success,
the most intriguing is when i added back the the failure, it just works, but it doesnt work together, i dont understand this..



For the main question..

but i think i want the Skolian Empire 10 will grabbed as series
and Triad 01 to #superseries (series-custom-column)

or anything like author - title
but i want it to import or add it to custom column?
how to do that?
yonkyunior is offline   Reply With Quote
Old 12-25-2015, 03:37 PM   #2
eschwartz
Ex-Helpdesk Junkie
eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.
 
eschwartz's Avatar
 
Posts: 19,422
Karma: 85397180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
Reading metadata from filenames doesn't support custom columns.
eschwartz is offline   Reply With Quote
Advert
Old 12-26-2015, 06:42 PM   #3
yonkyunior
Cultivator
yonkyunior doesn't litteryonkyunior doesn't litteryonkyunior doesn't litter
 
yonkyunior's Avatar
 
Posts: 94
Karma: 216
Join Date: Feb 2015
Device: PRST2
Quote:
Originally Posted by eschwartz View Post
Reading metadata from filenames doesn't support custom columns.
i hope i can do it,

mirror of plugboards i guess..
yonkyunior is offline   Reply With Quote
Reply

Tags
custom column, regex


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Custom column returns value based on value of another custom column? calvin-c Calibre 3 09-14-2013 02:24 PM
Custom yes/no column built from long text column Philantrop Library Management 7 03-23-2013 07:44 PM
how to move value(s) of tag column to a custom made column zoorakhan Library Management 0 12-08-2012 03:53 AM
Kindle: Show ebook reading status in custom column AndyW1691 Library Management 0 01-22-2012 04:40 PM
Lastname, Firstname filenames - Any way to import correct author name? Starson17 Calibre 5 12-23-2009 11:03 PM


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


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