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-16-2015, 12:49 AM   #1
Anthraquinone
Junior Member
Anthraquinone began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Dec 2015
Device: Kindle
Use file name as metadata ??

I have looked through this forum but cannot find the answer to an apparently simple question.
Is there any way of automatically copying the file name into the metadata. I want to do this on a batch of files if possible.
I have my own file naming convention and I would like to simply use that as the metadata (minus the file extension is possible)

So simplified example would have the file names

Space opera 01 - An adventure.mobi
Space Opera 02 - All die
etc

The the title fields of the metadata should be changed to

Space Opera 01 - An adventure
Space opera 02 - All die
etc

I would have thought that this would be easy to do but I cannot see how.

AQ
Anthraquinone is offline   Reply With Quote
Old 12-16-2015, 01:01 AM   #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,421
Karma: 85400180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
Preferences ==> Adding books
Uncheck "Read metadata from file contents rather than filename"
eschwartz is offline   Reply With Quote
Advert
Old 12-16-2015, 01:06 AM   #3
jecilop
Addict
jecilop will be dicovering the secret to cold fusion any day nowjecilop will be dicovering the secret to cold fusion any day nowjecilop will be dicovering the secret to cold fusion any day nowjecilop will be dicovering the secret to cold fusion any day nowjecilop will be dicovering the secret to cold fusion any day nowjecilop will be dicovering the secret to cold fusion any day nowjecilop will be dicovering the secret to cold fusion any day nowjecilop will be dicovering the secret to cold fusion any day nowjecilop will be dicovering the secret to cold fusion any day nowjecilop will be dicovering the secret to cold fusion any day nowjecilop will be dicovering the secret to cold fusion any day now
 
Posts: 260
Karma: 139980
Join Date: Mar 2014
Device: Android
1st - Preferences/Adding Books/The Add Process tab - uncheck the first box "Read metadata from file contents rather than the file name"

2nd - same place - at the bottom there is a test area where you can type a file name as above and play with the Regular Expression field to get what you want.
There are some pull down pre-made templates. This one: (?P<title>.+) will do exactly what you want as above. Note, however, it does NOT yield an author. That yields Unknown.

I just played with the expression: (?P<author>[^_-]+) -?\s*(?P<title>[^_].+) ?

It will give an author name and what you want IF your file names are set up such as:

Author Name - Space Opera 01 - An adventure.
jecilop is offline   Reply With Quote
Old 12-17-2015, 05:30 AM   #4
Anthraquinone
Junior Member
Anthraquinone began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Dec 2015
Device: Kindle
Thanks very much to eschwartz and jecilop. That was just what I was looking for. I had totally missed that option in Calibre.

I have not tried the expression you gave but I will. Although I think I know a little about computers these regular expressions are a bit of a mystery. I may be back for a bit of help.

AQ
Anthraquinone is offline   Reply With Quote
Old 12-17-2015, 11:36 AM   #5
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,421
Karma: 85400180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
Ask away, that's what we're here for.

If you want a good tutorial on regular expressions, I found http://www.regular-expressions.info to be extremely helpful.
It taught me everything I know about them, and is my go-to reference.
I particularly appreciated the step-by-step "Looking Inside The Regex Engine" sections.
eschwartz is offline   Reply With Quote
Advert
Reply

Tags
file name, metadata


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Metadata only for few file? scorpion2782 Calibre 11 05-05-2013 11:20 AM
Do I need this metadata file? CyberPotato Library Management 7 02-06-2013 12:22 AM
Importing metadata from file name alfredoc72 Library Management 0 12-21-2012 02:54 AM
getting metadata from source file duncombe Calibre 3 12-12-2011 01:22 PM
Metadata from File Name Logan06 Calibre 0 01-08-2011 10:53 PM


All times are GMT -4. The time now is 02:52 AM.


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