![]() |
#1 |
Junior Member
![]() 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 |
![]() |
![]() |
![]() |
#2 |
Ex-Helpdesk Junkie
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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" |
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Addict
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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. |
![]() |
![]() |
![]() |
#4 |
Junior Member
![]() 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 |
![]() |
![]() |
![]() |
#5 |
Ex-Helpdesk Junkie
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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. |
![]() |
![]() |
Advert | |
|
![]() |
Tags |
file name, metadata |
|
![]() |
||||
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 |