Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Software > Calibre

Notices

Reply
 
Thread Tools Search this Thread
Old 03-28-2021, 05:05 AM   #1
Dan Goodale
Junior Member
Dan Goodale began at the beginning.
 
Posts: 8
Karma: 10
Join Date: Dec 2019
Device: Honor 8
[Tip] DOS cmd file tools for Calibre searches

Hi guys. I have a lot of books and add to my libraries constantly. I'm at 52k right now, across 19 libraries and I was losing track of which books I had and where they were. I decided to write a couple of batch files to help me keep track of them and find them and thought other people might want to try them out too. They're tiny, easy to understand, and they work for me, so far.

First, from the root of your library, you run AllCalibreBooks.cmd to dump all the library file names into 1 file called Calibre_Books.txt. It will then sort the file names into alphabetical order and dump the filtered results into a file named CalibreBooksSorted.txt


del Calibre_Books.txt
del CalibreBooksSorted.txt
dir/s | findstr "azw mobi lit epub" > Calibre_Books.txt
echo File Created
echo SORTING
sort Calibre_Books.txt /O CalibreBooksSorted.txt

To search the new "database" you run BookSearch.cmd. You'll see a DOS box with the top line asking "Search for?" You can search for basically anything. An author name, a book name, the actual file name, a piece of a word...whatever.

You DO have to remember though that the only information it has collected is the standard file data, not the book metadata. Thankfully you'll get the first 70 letters in the book name, you'll get the author name, and the file location. Even with my library, the search is instant. For me so far, it's been quite valuable.

Here is the book search code:

@echo off
REM Book Search 0.6 3/28/2021
REM /I for case insensitive /C for looking for the whole string not just pieces

:START_HERE
set /P SearchFor="Search For?"
Findstr /I /C:"%SearchFor%" CalibreBooksSorted.txt
REM the &cls is supposed to clear the screen
pause&cls
GOTO :START_HERE

For me, this means I find the "lost" book from the Fantasy library in the Sci-Fi library, I DON'T download free Amazon books that I already have, and I can see at a glance EVERY book I have from an author at once instead of searching each library separately.

This forum has been very helpful to me so I hope someone will find this useful. It's nice to be a contributor for once instead of the guy crying for help. :-)

And remember, both files go in the root of your calibre library (although I use shortcuts for them, of course).

Last edited by Dan Goodale; 03-28-2021 at 05:07 AM.
Dan Goodale is offline   Reply With Quote
Old 03-28-2021, 05:28 AM   #2
Sirtel
Wizard
Sirtel ought to be getting tired of karma fortunes by now.Sirtel ought to be getting tired of karma fortunes by now.Sirtel ought to be getting tired of karma fortunes by now.Sirtel ought to be getting tired of karma fortunes by now.Sirtel ought to be getting tired of karma fortunes by now.Sirtel ought to be getting tired of karma fortunes by now.Sirtel ought to be getting tired of karma fortunes by now.Sirtel ought to be getting tired of karma fortunes by now.Sirtel ought to be getting tired of karma fortunes by now.Sirtel ought to be getting tired of karma fortunes by now.Sirtel ought to be getting tired of karma fortunes by now.
 
Sirtel's Avatar
 
Posts: 3,923
Karma: 116000000
Join Date: Jan 2014
Location: Estonia
Device: Kindle Oasis 3, Nook Glowlight Plus 7.8'', Kobo Libra H2O
While your tools are certainly very useful for several separate libraries, another solution is to use virtual libraries, not physical libraries. Then you can find everything with Calibre's own search.
Sirtel is offline   Reply With Quote
Advert
Old 03-28-2021, 06:32 AM   #3
Quoth
the rook, bossing Never.
Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.
 
Quoth's Avatar
 
Posts: 3,077
Karma: 23261818
Join Date: Jun 2017
Location: Ireland
Device: Both Kinds: epub based makes and Kindle
Also NOTHING to do with DOS. It's console or command line tools. Even on Windows NT, 2K, XP, Vista, 7, 8 and 10, the default is a console. Not DOS.

Older versions of NT based windows (via NTVDM) and DOS based windows did have a DOS console.

You can get a program called DOSbox, for many Operating Systems to run real MS-DOS (x86) on an emulator.
Quoth is offline   Reply With Quote
Old 04-02-2021, 05:07 AM   #4
Dan Goodale
Junior Member
Dan Goodale began at the beginning.
 
Posts: 8
Karma: 10
Join Date: Dec 2019
Device: Honor 8
Calibre tools

Thanks Sirtel, but when you have over 50,000 books, it takes a LONG TIME to search through all those books. So, I didn't want to, but I had to break it down into multiple libraries to get the performance I need.


Quoth, MS DOS was released in 1982. I used it. I also used ALL the other DOS versions AND wrote the deltree command used by Microsoft. Just because you grew up using a mouse and a keyboard doesn't mean the other software didn't exist. Lastly, correcting someone's use of a word inaccurately just shows you're a poser because those of us who actually KNOW all this stuff wouldn't bother to correct anything as trivial as a DOS BOX. Since you don't understand them you probably shouldn't use my tools.
Dan Goodale is offline   Reply With Quote
Old 04-02-2021, 06:46 AM   #5
Sirtel
Wizard
Sirtel ought to be getting tired of karma fortunes by now.Sirtel ought to be getting tired of karma fortunes by now.Sirtel ought to be getting tired of karma fortunes by now.Sirtel ought to be getting tired of karma fortunes by now.Sirtel ought to be getting tired of karma fortunes by now.Sirtel ought to be getting tired of karma fortunes by now.Sirtel ought to be getting tired of karma fortunes by now.Sirtel ought to be getting tired of karma fortunes by now.Sirtel ought to be getting tired of karma fortunes by now.Sirtel ought to be getting tired of karma fortunes by now.Sirtel ought to be getting tired of karma fortunes by now.
 
Sirtel's Avatar
 
Posts: 3,923
Karma: 116000000
Join Date: Jan 2014
Location: Estonia
Device: Kindle Oasis 3, Nook Glowlight Plus 7.8'', Kobo Libra H2O
Quote:
Originally Posted by Dan Goodale View Post
Thanks Sirtel, but when you have over 50,000 books, it takes a LONG TIME to search through all those books. So, I didn't want to, but I had to break it down into multiple libraries to get the performance I need.
No, it doesn't. I don't have 50,000 books, but I do have well over 20,000. The searching is still practically instant. Of course I have limited the searched metadata in Preferences, because for quick searches I generally search only for a title, author or series. For other categories I have to enter the category name in the search terms, but it still works very well.

Perhaps you should also limit the searched metadata to only those categories you use often.
Sirtel is offline   Reply With Quote
Advert
Old 04-02-2021, 08:23 AM   #6
Quoth
the rook, bossing Never.
Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.
 
Quoth's Avatar
 
Posts: 3,077
Karma: 23261818
Join Date: Jun 2017
Location: Ireland
Device: Both Kinds: epub based makes and Kindle
Quote:
Originally Posted by Dan Goodale View Post
Quoth, MS DOS was released in 1982. I used it. I also used ALL the other DOS versions AND wrote the deltree command used by Microsoft. Just because you grew up using a mouse and a keyboard doesn't mean the other software didn't exist. Lastly, correcting someone's use of a word inaccurately just shows you're a poser because those of us who actually KNOW all this stuff wouldn't bother to correct anything as trivial as a DOS BOX. Since you don't understand them you probably shouldn't use my tools.
Big assumptions. I used CP/M and then CP/M 86 and MS DOS from 1981 on an ACT Sirus 1 (USA Victor 9000) before IBM PC was sold on the island of Ireland. I wrote a combo platform-point&click engine in Modula-2 for DOS, among other things, with support for Hercules, CGA, EGA and VGA using Modula-2 Graphics drivers I wrote from scratch.

Correct names matter. It's NOTHING to do with DOS. Console commands or Command Line options.
DosBox is an emulator I've used for over 10 years on NT, Symbian and Linux also now on Android. I'm not being picky, you are being careless and fragile.

I'm happy for people to call a directory a folder. Sometimes real DOS commands are still used. Mostly in the DOSbox emulator. Not in a Win10, Linux or Mac Console.

The correct terminology is important because actual DOS commands and programs are still in use.

Last edited by Quoth; 04-02-2021 at 08:29 AM.
Quoth is offline   Reply With Quote
Old 04-02-2021, 11:47 AM   #7
ownedbycats
Wizard
ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.
 
ownedbycats's Avatar
 
Posts: 2,349
Karma: 9965688
Join Date: Oct 2018
Device: Kobo Aura HD
Quote:
Originally Posted by Dan Goodale View Post
Quoth, MS DOS was released in 1982. I used it. I also used ALL the other DOS versions AND wrote the deltree command used by Microsoft. Just because you grew up using a mouse and a keyboard doesn't mean the other software didn't exist. Lastly, correcting someone's use of a word inaccurately just shows you're a poser because those of us who actually KNOW all this stuff wouldn't bother to correct anything as trivial as a DOS BOX. Since you don't understand them you probably shouldn't use my tools.
No, Quoth is right. DOS refers to the operating system itself. Believe it or not, GUI applications existed for DOSes, including MS-DOS. Windows was one.

cmd.exe is the NT command line interface. It is not DOS. DOS used COMMAND.COM.

Last edited by ownedbycats; 04-02-2021 at 11:56 AM.
ownedbycats is online now   Reply With Quote
Old 04-02-2021, 02:21 PM   #8
Quoth
the rook, bossing Never.
Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.
 
Quoth's Avatar
 
Posts: 3,077
Karma: 23261818
Join Date: Jun 2017
Location: Ireland
Device: Both Kinds: epub based makes and Kindle
I used a console on Cromix in 1980s.
I used the NT Console from 1994 till now on NT 3.51 (1994), NT 4.0 (1996), Win 2000, XP, Vista, Win7 and Win 10.
The NT console originally could run OS/2 console applications, native NT console applications (I wrote several) and DOS using different subsystems. It used also include a Virtual Machine for both DOS applications and 16 bit windows, though the actual win 16 API was emulated via a module that called Win32 API, The NTVDM. So that worked on the Power PC, MIPS and Alpha.
But on non-NT Windows, any DOS window worked better full screen as there was no NTVDM, the commands used the actual DOS that was booted to load windows, typically DOS 3.3, though you could get DR-DOS to work, though MS added stuff to prevent most people loading Windows from it. Win 3.x
The Win9x wasn't a real 32 bit OS. It had the Win32s option on Win3.x integrated. It loaded off DOS 7. So it was poor on a Pentium Pro as it had no method to directly execute x86 16bit. NT used the NTVDM, so no DOS or 16 bit Windows instructions were ever run on any version of NT.
The totally broken Win ME used DOS 8 to load and run DOS programs. I can't remember how many of them got re-installed with Win 98SE, or NT 4.0. The NT 5.0 = Win 2K wasn't ever quite finished. We and our customers stayed with NT 4.0 till XP was out, and by then the Windows 2000 Server wasn't bad, but often servers by in 2002 were NT 4.0 or Linux.

Sorry for being pedantic.

But actually there are some useful DOS programs still and people do install DOSBox.
An incomplete list
Code:
Click here to download DOSBox 0.74-3 for your Operating System, or to support us with a donation:
Download DOSBox DOS Emulator
	DOSBox (specific versions)
Mac OS X 	0.74-3-3 	dmg (Universal)
Windows 	0.74-3 	Win32 installer
Fedora 	0.74-3 	rpm
Source 	0.74-3 	Source
Debian 	0.74-3 	deb
FreeBSD package 	0.74-2 	ports
RISC OS 	0.74-2 	zip
Gentoo Linux 	0.74 	portage
OS/2 	0.74 	exe (OS2)
Solaris 10 - sparc 	0.73 	pkg
BeOS 	0.63 	binary (x86)
https://www.dosbox.com/download.php?main=1

The main difficulty is not having physical keyboard (and maybe a mouse) on Symbian and Android. The Android one is on the Playstore.
Mostly people use it for old games.

Last edited by Quoth; 04-02-2021 at 02:24 PM.
Quoth is offline   Reply With Quote
Old 04-02-2021, 07:22 PM   #9
ownedbycats
Wizard
ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.
 
ownedbycats's Avatar
 
Posts: 2,349
Karma: 9965688
Join Date: Oct 2018
Device: Kobo Aura HD
Quote:
Originally Posted by Quoth View Post
It used also include a Virtual Machine for both DOS applications and 16 bit windows, though the actual win 16 API was emulated via a module that called Win32 API, The NTVDM. So that worked on the Power PC, MIPS and Alpha.
Sadly NTVDM is not available on 64-bit versions of Windows. So running old 16-bit Windows applications, mostly games, can't be done normally. There are other ways though (DOSBox running Windows 3.1, Wine, a hacked 64-bit version of NTDVM...)

Also, quite a few 32-bit applications used 16-bit installers. Thankfully if it's InstallShield you can just swap it out with a generic 32-bit version and that usually works.

Quote:
Originally Posted by Quoth View Post
The totally broken Win ME
On an old computer I had, Windows ME would throw a BSOD whenever I tried to shut it down.

Last edited by ownedbycats; 04-02-2021 at 07:31 PM.
ownedbycats is online now   Reply With Quote
Old 04-02-2021, 07:28 PM   #10
BetterRed
null operator
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: 17,078
Karma: 19750262
Join Date: Mar 2012
Location: Sydney Australia
Device: none
Quote:
Originally Posted by Sirtel View Post
No, it doesn't. I don't have 50,000 books, but I do have well over 20,000. The searching is still practically instant. Of course I have limited the searched metadata in Preferences, because for quick searches I generally search only for a title, author or series. For other categories I have to enter the category name in the search terms, but it still works very well.

Perhaps you should also limit the searched metadata to only those categories you use often.
↑ ↑ ↑ ✔

I have a library of 184,355 public domain articles.

The only column I exclude from search is my #blurb/Blurb custom column, an equivalent of comments/Comments. The difference being that custom long text columns can be edited in the book list via F2, whereas Comments must be edited via the Metadata Edit popup dialogue.

If I want all the articles by a particular author I'm usually looking at one of them, so I just press Alt+A and all the articles by that author are displayed more or less instantly - including those for which he/she is not the primary author.

Searches by tag values, publisher names etc are similarly more or less instant.

I use Windows Search and the Drop Search Results plugin for content searches.

BR

Last edited by BetterRed; 04-02-2021 at 07:32 PM.
BetterRed is offline   Reply With Quote
Old 04-03-2021, 09:29 PM   #11
ownedbycats
Wizard
ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.
 
ownedbycats's Avatar
 
Posts: 2,349
Karma: 9965688
Join Date: Oct 2018
Device: Kobo Aura HD
Theres a few things that can slow down searches/Calibre in general:

1. Database that has accumulated too much crud over time. Running Library > Library Maintenance > Check Library every so often is good practice.
2. Composite columns. Too many of them, or overly complex ones, or the dreaded virtual_libraries() function, can slow things down.
3. A failing hard drive. I had one die a few years back. Calibre got pretty laggy shortly before I recognized it.
ownedbycats is online now   Reply With Quote
Old 04-04-2021, 05:13 AM   #12
chaley
Grumpy old git
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
chaley's Avatar
 
Posts: 9,734
Karma: 3174216
Join Date: Jan 2010
Location: UK
Device: Reader
Quote:
Originally Posted by ownedbycats View Post
2. the dreaded virtual_libraries() function, can slow things down.
The "virtual_libraries()" performance problem was fixed in calibre 5.14.
chaley is offline   Reply With Quote
Old 04-04-2021, 05:19 AM   #13
ownedbycats
Wizard
ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.
 
ownedbycats's Avatar
 
Posts: 2,349
Karma: 9965688
Join Date: Oct 2018
Device: Kobo Aura HD
Oh I didn't realize. That's good.
ownedbycats is online now   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
HELP-Start Calibre-Server DOS Comand Line JimJoatMon Server 2 10-20-2019 08:10 PM
Passing tray cmd line arguments to Calibre PA stisev Calibre 5 02-24-2019 07:29 AM
Stopping Calibre Server from Cmd Line? phossler Calibre 5 09-27-2016 04:46 PM
Stdout for Calibre cmd Dimsok Related Tools 1 05-03-2016 09:57 AM
File organizing tip GhostHawk Ectaco jetBook 2 02-14-2010 11:13 AM


All times are GMT -4. The time now is 03:50 AM.


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