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

Go Back   MobileRead Forums > E-Book Software > Calibre

Notices

Reply
 
Thread Tools Search this Thread
Old 08-22-2010, 09:19 PM   #1
volkermord
Junior Member
volkermord began at the beginning.
 
Posts: 1
Karma: 10
Join Date: Aug 2010
Device: Ipad
Using Folder Names as Metadata

All my ebooks are in a pretty basic format, but Calibre is not picking up the naming structure properly which is causing me to have to hand edit a lot of the files (we're talking a very large collection). So here's my setup:
Alphabet Letter as parent folder,
Author as sub folder
ebooks (with the name structure of <Series> - <# in series> - <Title> =or= <Title>

So I want to know if it's possible to pull the Author from the folder name, the Series, # and Title from the filenames (and for those without a series get the Title in the right location, instead of trying to use the title as the series)
I know in the end I'm probably going to have to do a lot of handwork, which I'm ok with, but fetching the metadata would be so much easier if it would figure out the Authors, and maybe not use the entire filename as the Title.

I search all over the forums, and google, and I don't normally like making posts to bug other people with questions but...
I'll be forever grateful to whomever could me
volkermord is offline   Reply With Quote
Old 08-22-2010, 10:35 PM   #2
DoctorOhh
US Navy, Retired
DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.
 
DoctorOhh's Avatar
 
Posts: 9,864
Karma: 13806776
Join Date: Feb 2009
Location: North Carolina
Device: Icarus Illumina XL HD, Nexus 7
Quote:
Originally Posted by volkermord View Post
So I want to know if it's possible to pull the Author from the folder name
No, but if you do one author at a time you can select all of the new entries and add the author to them all in one edit.

Quote:
Originally Posted by volkermord View Post
the Series, # and Title from the filenames (and for those without a series get the Title in the right location, instead of trying to use the title as the series)
Yes, check under Preferences - Add/Save and check Read metadata from file name. Then use the Regex below to set the import for your file names.

Try
Quote:
<series> - <series_index> - <title>
to start.

Use the test tool by inserting one of your book names (including the extension .txt) to see if you have what you want.
DoctorOhh is offline   Reply With Quote
Advert
Old 08-23-2010, 04:07 AM   #3
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 11,704
Karma: 6658935
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by volkermord View Post
So here's my setup:
Alphabet Letter as parent folder,
Author as sub folder
ebooks (with the name structure of <Series> - <# in series> - <Title> =or= <Title>

So I want to know if it's possible to pull the Author from the folder name, the Series, # and Title from the filenames (and for those without a series get the Title in the right location, instead of trying to use the title as the series)
When importing books, check the option preferences -> adding books -> Read metadata only from file name, then use the regular expression
Code:
./(?P<author>.*)/((?P<series>.*) - (?P<series_index>.*) - )?(?P<title>.*)
The regexp matches correctly when tested with the file names
Code:
s/john smith/Some Series - 1 - Title.epub
and
Code:
s/john smith/Title.epub
chaley is offline   Reply With Quote
Old 08-23-2010, 02:16 PM   #4
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 chaley View Post
When importing books, check the option preferences -> adding books -> Read metadata only from file name, then use the regular expression
Code:
./(?P<author>.*)/((?P<series>.*) - (?P<series_index>.*) - )?(?P<title>.*)
The regexp matches correctly when tested with the file names
Code:
s/john smith/Some Series - 1 - Title.epub
and
Code:
s/john smith/Title.epub
Charles - are you sure about this? I thought we couldn't get the path when parsing with the regex during Add. I tested, and like you, I got a success during a test of the regex, but not during an actual Add. I thought the path was being stripped off the filename before it was passed to the regex for parsing into metadata. (I had to modify the separators to double backslashes for Windows to get the test to work - I tried an actual Add with both double backslashes and single forward slashes.)

Usually, I would take a look at the code, and put in a print statement to see if the path is there before parsing with the regex, but I'm really short on time. If this is actually working for someone to get metadata from a folder name, I'd appreciate confirmation (and also what OS it is working on.)
Starson17 is offline   Reply With Quote
Old 08-23-2010, 02:49 PM   #5
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 11,704
Karma: 6658935
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by Starson17 View Post
Charles - are you sure about this? I thought we couldn't get the path when parsing with the regex during Add.
Nope, wasn't sure about it. I took the easy way out and just used the tester. You are absolutely right. The code uses only the last component of a path, so the regexp won't work in anger.

The OP could use the regexp by doing a bulk rename of a/b/c to a/b - c, but that has its own complexities.
chaley is offline   Reply With Quote
Advert
Old 08-23-2010, 03:29 PM   #6
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 chaley View Post
The OP could use the regexp by doing a bulk rename of a/b/c to a/b - c, but that has its own complexities.
Somewhere here there was a discussion of a flexible file rename utility that uses regexp in the file rename operation. I haven't had a chance to look at it, but it might do the job. It did look like a nice utility for those who are comfortable using regexp.
Starson17 is offline   Reply With Quote
Old 08-24-2010, 01:22 AM   #7
Cryolithic
Junior Member
Cryolithic began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Aug 2010
Device: Android - Personal Ebook App
http://www.bulkrenameutility.co.uk/Main_Intro.php
Cryolithic is offline   Reply With Quote
Old 08-24-2010, 01:36 AM   #8
Cryolithic
Junior Member
Cryolithic began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Aug 2010
Device: Android - Personal Ebook App
It will probably take a couple of passes (I'm doing the same thing with my collection as I write this)

I'll post the steps and regexes for Bulk Rename Util as I do it.

First step, stripping out Series Name/#

Match: ([A-Za-zA-Z0-9'\. ]*)(-? ?[0-9\.]* ?- ?)(.*)
replace: \3

In the box that says Append Folder name, set prefix, a seperator, and level.

Make sure you check the box for subfolders

This *should* get most of the items.

Last edited by Cryolithic; 08-24-2010 at 02:06 AM.
Cryolithic is offline   Reply With Quote
Reply

Tags
author, calibre, ebook, folder name, metadata

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Help with "Guessing metadata from file names" Justy Library Management 22 08-15-2011 06:13 AM
sub-folder support for documents folder? sark666 Kobo Reader 5 08-31-2010 05:35 AM
Help finding Metadata Names and Values? Sabardeyn ePub 3 04-02-2010 11:16 PM
How can I remove spaces from folder and file names? jusmee Calibre 1 11-06-2009 10:36 PM


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


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