View Single Post
Old 02-01-2015, 07:13 PM   #6
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: 85400180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
That is when I pull out find, but I am not sure that can be duplicated in Windows batch without using gfind from gow or something. Which obviously requires downloading and installing yet more tools (and most people don't need unix tools for windows on an ongoing basis).

But the OP said "a folder", so hopefully... ?

...

Or something like:

Code:
recursedirs()
{
for file in *.epub *.mobi *.azw3 *.txt */ ; do
    if [[ -d "${file}" ]]; then
        cd "${file}"
        recursedirs
    else
        calibredb add "${file}"
    fi
done
}
Obviously, the best way of doing it is with "calibredb add --recurse ./" or the equivalent via the GUI.
The one time this won't work is when you want to import files from all over and don't want calibre to search your entire C: drive trying to find books -- then I guess a dedicated Ransack would be better for weeding out the noise. Because calibre will of course pick up on a lot of stuff, including HTML and ZIP files and all word documents etc.

calibre is capable of traversing a single directory tree and importing all recognized ebook types, recursively, on its own though -- if that is what you need.
eschwartz is offline   Reply With Quote