![]() |
#1 |
Junior Member
![]() Posts: 2
Karma: 10
Join Date: Aug 2016
Location: Munich, Germany
Device: (Kindle - Potentially)
|
Create tags while importing from source folder structure
Hi folks,
I've done some amount of classifying of my book collection, but on first couple of trials importing to Calibre no tags were created (unchecking 'Read metadata from file contents rather than file name' made no difference) The source folder structure has for instance Business > Entrepreneurship >> Business Model Generation (PDF Templates) > Leadership >> Team Leader How can I setup the import process to write a tag for the Folder/Sub-Folder Name? Many thanks /Eamonn Last edited by eamonned; 08-15-2016 at 12:14 PM. Reason: indentation removed when posting |
![]() |
![]() |
![]() |
#2 |
Junior Member
![]() Posts: 2
Karma: 10
Join Date: Aug 2016
Location: Munich, Germany
Device: (Kindle - Potentially)
|
Perhaps I've posted this in the wrong forum?
Anyways - here's version 1 of my fix for this From the folder & subfolders containing the files that you wish to add to Calibre, execute something like this... c:\Books\Hobbies\Woodworking>forfiles.exe /s /m *.pdf /c "cmd /c calibredb add --duplicates --tags ^0x22Woodworking, Hobbies, @fdate^0x22 @path" Some explanation forfiles.exe - for all of the files that match (/m) /s - include subfolders /m *.pdf - match all pdfs in my case /c - for every file execute what follows "cmd /c calibredb add --duplicates - I want the process to continue even if it finds a duplicate --tags ^0x22 Tag1, tag2, tag3 ^0x22 - the tags need to be surrounded by the Hexadecimal code for " (quotation marks) - this is the part that took my quite some time to figure out @fdate - I included this within the Tags - it will add the files last modified date @path - this is the book that is being processed and will be sent to Calibre with the given tags So basically Copy this line forfiles.exe /s /m *.pdf /c "cmd /c calibredb add --duplicates --tags ^0x22%TAG_1%, %TAG_2%^0x22 @path" and change %TAG_1% and %TAG_2% (or add others) as it suits you Hope this helps someone Best /E |
![]() |
![]() |
Advert | |
|
![]() |
#3 |
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)
|
calibre does not derive metadata from the full pathname of imported books, only the filename.
Your solution works, although it is more common to use a bulk file renamer to make sure the filename contains all the information formerly in the full pathname. |
![]() |
![]() |
![]() |
#4 |
Connoisseur
![]() Posts: 54
Karma: 10
Join Date: Dec 2015
Device: kpw2
|
This @path option seems to no longer work, it just adds %TAG_1% and %TAG_2% to the tag field.
Anyone knows why/how to make it work again? Thanks |
![]() |
![]() |
![]() |
#5 | |
null operator (he/him)
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 20,679
Karma: 26966376
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
Quote:
Added : and test the calibredb part singularly, calibre has moved on since August 2016. BR Last edited by BetterRed; 01-24-2019 at 04:18 PM. |
|
![]() |
![]() |
Advert | |
|
![]() |
#6 | |
Deviser
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,265
Karma: 2090983
Join Date: Aug 2013
Location: Texas
Device: none
|
"Media File Importer" Plug-in
Quote:
In 2019 in Calibre, the only way you can derive metadata from a complex folder structure is to use the Calibre plug-in "Media File Importer" to create a book with all of your desired metadata via its use of "Dynamic Variables". You can add multiple ebook formats to that same Calibre book via drag-and-drop. https://www.mobileread.com/forums/sh...d.php?t=277104 DaltonST Last edited by DaltonST; 01-28-2019 at 09:45 AM. |
|
![]() |
![]() |
![]() |
Tags |
import process, tag management |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Reimport books from another folder to Calibre folder structure? | mendhak | Calibre | 2 | 10-11-2013 01:18 AM |
Using folder structure to generate tags? | leehach | Library Management | 2 | 05-19-2011 04:39 PM |
Directory Structure Calibre after importing | Tuborg | Calibre | 2 | 01-16-2011 06:25 AM |
PRS505 Folder Structure | gixxermenace | Sony Reader | 5 | 07-14-2009 02:47 PM |
SD Folder structure | ctitanic | Amazon Kindle | 1 | 12-30-2007 12:48 PM |