Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre

Notices

Reply
 
Thread Tools Search this Thread
Old 09-15-2013, 12:26 PM   #1
geruser
Junior Member
geruser began at the beginning.
 
Posts: 1
Karma: 10
Join Date: Sep 2013
Device: none
Convert subdirs to categories while importing automatically

Hi,
I want to import a huge subdir-structure into calibre. I learned that calibre will rearrange the books in the library.

The library now is organized by subject. E. g.: The Book 'DNS in action.pdf' is located in 'c:\books\sysadmin\linux\dns'. When importing this book automatically I want to auto-add the categories 'sysadmin', 'linux' and 'dns'. Another example: The book 'stranger in a strange land.txt' is located in 'c:\books\fiction\english\heinlein'. And here I want the categories 'fiction', 'english' and 'heinlein'. I know that heinlein must be the name of the author. But that comes later because I can't get metadata from a txt-file. I can live - for some time - with author = unknown as long as I have the category 'heinlein'.

How do I have to set up the import process to achieve this?
geruser is offline   Reply With Quote
Old 09-15-2013, 12:44 PM   #2
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: 29,803
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Quote:
Originally Posted by geruser View Post
Hi,
I want to import a huge subdir-structure into calibre. I learned that calibre will rearrange the books in the library.

The library now is organized by subject. E. g.: The Book 'DNS in action.pdf' is located in 'c:\books\sysadmin\linux\dns'. When importing this book automatically I want to auto-add the categories 'sysadmin', 'linux' and 'dns'. Another example: The book 'stranger in a strange land.txt' is located in 'c:\books\fiction\english\heinlein'. And here I want the categories 'fiction', 'english' and 'heinlein'. I know that heinlein must be the name of the author. But that comes later because I can't get metadata from a txt-file. I can live - for some time - with author = unknown as long as I have the category 'heinlein'.

How do I have to set up the import process to achieve this?
Path structure to metadata can not be done automatically.

If your scripting skills are up to it , The CLI (see the Help pages) may work for you

If you add from small segments of the paths: you might set the 'Tags To Apply' (preferences: Adding Books) each time you add that group
theducks is offline   Reply With Quote
Advert
Old 09-15-2013, 01:56 PM   #3
Adoby
Handy Elephant
Adoby ought to be getting tired of karma fortunes by now.Adoby ought to be getting tired of karma fortunes by now.Adoby ought to be getting tired of karma fortunes by now.Adoby ought to be getting tired of karma fortunes by now.Adoby ought to be getting tired of karma fortunes by now.Adoby ought to be getting tired of karma fortunes by now.Adoby ought to be getting tired of karma fortunes by now.Adoby ought to be getting tired of karma fortunes by now.Adoby ought to be getting tired of karma fortunes by now.Adoby ought to be getting tired of karma fortunes by now.Adoby ought to be getting tired of karma fortunes by now.
 
Adoby's Avatar
 
Posts: 1,736
Karma: 26785668
Join Date: Dec 2009
Location: Southern Sweden, far out in the quiet woods
Device: Thinkpad E595, Ubuntu Mate, Huawei Mediapad 5, Bouye Likebook Plus
As the ducks says, elements from the path can't be used when importing, only from the filename.

One way you could fix this is to rename all your files to include what is now the path into the filename. And then do the import.

For instance rename

c:\books\sysadmin\linux\dns\Alena Kabelová & Libor Dostálek - DNS in Action.pdf

To

c:\books\sysadmin.linux.dns - Alena Kabelová & Libor Dostálek - DNS in Action.pdf

Then do the import. Read in the whole name as the title. After that use some bulk metadata search and replace with regex to put the right parts of the title into the fields #subject, authors and title.

It should be possible to automate most of the process and do it in bulk.

For instance list all books recursively and put the names and paths in a text file. Then use some editor or other tool to convert in bulk each line into a copy or rename command. Excel or Libre Calc would be possible to use. As would most advanced editors with scripting.

Then run the script to rename all the files in one fell swoop, and do the import in bulk.

One problem is that the filenames may become too long if you are working in Windows. Linux should work better.
Adoby is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Convert/Delete Tags Automatically iridius Library Management 2 02-23-2011 09:47 AM
Automatically convert Dark123 Calibre 10 08-27-2010 06:07 PM
Automatically convert file to EPUB upon import into library astrodad Calibre 6 07-23-2010 12:22 PM
Automatically convert Foldernames to Tags in Calibre ? funky Calibre 0 07-19-2010 06:36 AM
question/suggestion: convert directly and make importing of sourcefile optional dura Calibre 0 09-09-2009 06:05 AM


All times are GMT -4. The time now is 01:23 AM.


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