05-19-2015, 08:24 PM | #1 |
Member
Posts: 16
Karma: 10
Join Date: Nov 2013
Device: tolino vision 4 HD
|
How to get author data from folder name? (importing a lot of cbz)
Hi,
I have got a little problem and I hope you guys can help me out. There is a huge collection of cbz-files which I want to catalogue in calibre. Unfortunately, the files themselves do not contain any metadata such as "author". Instead you can find the files in the their author's folder. Example: Author A has written three books B1, B2 and B3. There is one folder called "Author A" which contains all three books. There are a hella lot of them, so importing them as usual would result in countless hours of re-tagging the files with "author" which I want to avoid. So, here is my question: Is there any way to use the folders' names with the information of the author? (or in other words: Can Calibre automatically tag the files with the author-data from their folders?) |
05-19-2015, 09:44 PM | #2 | |
null operator (he/him)
Posts: 21,006
Karma: 27620706
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
Quote:
Then you could use a template in Add Books such as (?P<author>[^_]+) - (?P<title>.+) and use this add option BR |
|
Advert | |
|
05-19-2015, 10:14 PM | #3 |
Well trained by Cats
Posts: 30,451
Karma: 58055868
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
Just clarify:
Calibre is Path unaware. Onlu the filename is usable The method BR suggested is a good way to work around this. If the folders were fairly densely populated, you could import 1 folder at a time and bulk Metadata edit change the Author. spin, rinse, repeat |
05-20-2015, 12:45 PM | #4 |
Member
Posts: 16
Karma: 10
Join Date: Nov 2013
Device: tolino vision 4 HD
|
Okay, thanks for clarifying. I will try to play with the file names a little bit. I guess batch renaming should still be more comfortable than importing them folderwise as there a many folders with only one file in it. T.T
|
05-21-2015, 08:21 AM | #5 |
Addict
Posts: 250
Karma: 1702156
Join Date: Nov 2010
Device: Kindle Voyage
|
If you don't already have a favorite batch renamer you might consider AdvancedRenamer:
http://www.advancedrenamer.com/ It's free and it has the specific ability to rename a file using folder names. It also handles regex for complex file renaming. |
Advert | |
|
05-21-2015, 06:47 PM | #6 | |
Member
Posts: 16
Karma: 10
Join Date: Nov 2013
Device: tolino vision 4 HD
|
Quote:
My cbz-files do have this name pattern: [Author A (pseudonym if available)] Title YXZ [random tag: e.g. translated] (<-- square brackets!) As it does not work with this regex expression "(?P<author>[^_]+) - (?P<title>.+)", I had to either change the regex or the name. Sadly, I wasn't able to change the regex (though I tried), because I don't quite understand this stuff. So I had to change the names, but this is kinda time consuming. Is there a way to change the regex so it fits the required pattern? Sorry for having a lot of questions . PS: It does suffice if calibre can extract the whole author part. I can re-tag the pseudonyms later manually T.T, shouldn't take me thaaat long ^^'. Many thanks! (I will try to understand this regex stuff, too, could be useful *sigh*) |
|
05-22-2015, 12:49 AM | #7 |
Ex-Helpdesk Junkie
Posts: 19,421
Karma: 85397180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
|
How does this look? (EDIT: fixed unescaped brackets)
Code:
\[(?P<author>[^\]]+)\] (?P<title>[^\]]+) \[(?P<tags>.+)\] Code:
[author_fn author_ln (optional_pseudonym)] title [tag1, tag2] More about regex, if you are interested: http://regular-expressions.info Last edited by eschwartz; 06-10-2015 at 11:12 PM. Reason: dur.... |
05-22-2015, 08:54 PM | #8 |
Member
Posts: 16
Karma: 10
Join Date: Nov 2013
Device: tolino vision 4 HD
|
Hi, I've tested everything and so far it is working fine. OFC the inconsistent naming methods of my folders aren't making it easy for me, but it's doable ^^. (some are just named in a completely different way T.T)
I had to change your code a little bit, though, eschwartz. It seems that we do need some backslashes in front of the squared brackets, because squared brackets are something special and therefore not recognized as simple letters/chars (I kinda did my homework, though I can't build complex expressions yet lol). Thanks, everyone, we were on the right track! |
06-05-2015, 04:16 AM | #9 |
Enthusiast
Posts: 48
Karma: 10
Join Date: Nov 2010
Location: Niš, Srbija
Device: Tablet (Android)
|
Maybe in TC -> [P] - [N]
Sorry if I miss. |
06-10-2015, 11:11 PM | #10 | |
Ex-Helpdesk Junkie
Posts: 19,421
Karma: 85397180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
|
Quote:
Glad I could help. |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Importing HTML Meta Data Options | RonBall42 | Sigil | 1 | 08-12-2014 12:39 PM |
CBZ containing folder | daigo75 | Calibre | 4 | 08-05-2010 04:17 PM |
importing from calibre to itunes with album data | 07thompsone | Calibre | 16 | 07-11-2010 06:20 AM |
Folder customization when importing | Heathen | Calibre | 8 | 06-01-2010 03:40 AM |