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 05-19-2015, 08:24 PM   #1
Wimi_Bussard
Member
Wimi_Bussard began at the beginning.
 
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?)
Wimi_Bussard is offline   Reply With Quote
Old 05-19-2015, 09:44 PM   #2
BetterRed
null operator (he/him)
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 21,006
Karma: 27620706
Join Date: Mar 2012
Location: Sydney Australia
Device: none
Quote:
Originally Posted by Wimi_Bussard View Post
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?)
@Wimi_Bussard - one way would be to use an OS level renamer that has the ability to include parent folder name in the rename, so that you end up with file names like "Author A - B1".

Then you could use a template in Add Books such as (?P<author>[^_]+) - (?P<title>.+) and use this add option

Click image for larger version

Name:	Screenshot - 2015-05-20 , 10_38_53.jpg
Views:	308
Size:	40.5 KB
ID:	138485

BR
BetterRed is offline   Reply With Quote
Advert
Old 05-19-2015, 10:14 PM   #3
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
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
theducks is offline   Reply With Quote
Old 05-20-2015, 12:45 PM   #4
Wimi_Bussard
Member
Wimi_Bussard began at the beginning.
 
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
Wimi_Bussard is offline   Reply With Quote
Old 05-21-2015, 08:21 AM   #5
drjenkins
Addict
drjenkins ought to be getting tired of karma fortunes by now.drjenkins ought to be getting tired of karma fortunes by now.drjenkins ought to be getting tired of karma fortunes by now.drjenkins ought to be getting tired of karma fortunes by now.drjenkins ought to be getting tired of karma fortunes by now.drjenkins ought to be getting tired of karma fortunes by now.drjenkins ought to be getting tired of karma fortunes by now.drjenkins ought to be getting tired of karma fortunes by now.drjenkins ought to be getting tired of karma fortunes by now.drjenkins ought to be getting tired of karma fortunes by now.drjenkins ought to be getting tired of karma fortunes by now.
 
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.
drjenkins is offline   Reply With Quote
Advert
Old 05-21-2015, 06:47 PM   #6
Wimi_Bussard
Member
Wimi_Bussard began at the beginning.
 
Posts: 16
Karma: 10
Join Date: Nov 2013
Device: tolino vision 4 HD
Quote:
Originally Posted by drjenkins View Post
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.
Thanks, that's the tool I used, too. I only have got one problem, I don't get the regex commands of calibre.

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*)
Wimi_Bussard is offline   Reply With Quote
Old 05-22-2015, 12:49 AM   #7
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: 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>.+)\]
Matches:
Code:
[author_fn author_ln (optional_pseudonym)] title [tag1, tag2]
It assumes there MUST be a tag(s), but that can be made optional. Also, I don't know how you handle pseudonyms, but you cannot use custom columns in an Add regex so I just matched the pseudonym in with the author name. You can fix that manually later.


More about regex, if you are interested: http://regular-expressions.info

Last edited by eschwartz; 06-10-2015 at 11:12 PM. Reason: dur....
eschwartz is offline   Reply With Quote
Old 05-22-2015, 08:54 PM   #8
Wimi_Bussard
Member
Wimi_Bussard began at the beginning.
 
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!
Wimi_Bussard is offline   Reply With Quote
Old 06-05-2015, 04:16 AM   #9
crnirg
Enthusiast
crnirg began at the beginning.
 
Posts: 48
Karma: 10
Join Date: Nov 2010
Location: Niš, Srbija
Device: Tablet (Android)
Maybe in TC -> [P] - [N]

Sorry if I miss.
crnirg is offline   Reply With Quote
Old 06-10-2015, 11:11 PM   #10
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: 85397180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
Quote:
Originally Posted by Wimi_Bussard View Post
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!
How mortifying. Good catch.


Glad I could help.
eschwartz is offline   Reply With Quote
Reply


Forum Jump

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


All times are GMT -4. The time now is 01:43 PM.


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