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 08-15-2016, 10:53 AM   #1
eamonned
Junior Member
eamonned began at the beginning.
 
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
eamonned is offline   Reply With Quote
Old 08-18-2016, 11:27 AM   #2
eamonned
Junior Member
eamonned began at the beginning.
 
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
eamonned is offline   Reply With Quote
Advert
Old 08-18-2016, 12:34 PM   #3
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)
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.
eschwartz is offline   Reply With Quote
Old 01-24-2019, 12:10 PM   #4
font332
Connoisseur
font332 began at the beginning.
 
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
font332 is offline   Reply With Quote
Old 01-24-2019, 03:36 PM   #5
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: 20,679
Karma: 26966376
Join Date: Mar 2012
Location: Sydney Australia
Device: none
Quote:
Originally Posted by font332 View Post
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?
You should ask Microsoft, @path is a parameter of their forfiles utility.

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.
BetterRed is offline   Reply With Quote
Advert
Old 01-28-2019, 09:37 AM   #6
DaltonST
Deviser
DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.
 
DaltonST's Avatar
 
Posts: 2,265
Karma: 2090983
Join Date: Aug 2013
Location: Texas
Device: none
"Media File Importer" Plug-in

Quote:
Originally Posted by font332 View Post
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

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.
DaltonST is offline   Reply With Quote
Reply

Tags
import process, tag management


Forum Jump

Similar Threads
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


All times are GMT -4. The time now is 12:33 AM.


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