![]() |
#1 |
Junior Member
![]() 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? |
![]() |
![]() |
![]() |
#2 | |
Well trained by Cats
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 30,914
Karma: 60358908
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
Quote:
If your scripting skills are up to it ![]() 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 |
|
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Handy Elephant
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,737
Karma: 26785684
Join Date: Dec 2009
Location: Southern Sweden, far out in the quiet woods
Device: Samsung Galaxy Tab S8 Ultra
|
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. |
![]() |
![]() |
![]() |
|
![]() |
||||
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 |