![]() |
#1 |
Junior Member
![]() Posts: 9
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. |
![]() |
![]() |
![]() |
#2 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 13,467
Karma: 239219543
Join Date: Jan 2014
Location: Estonia
Device: Kobo Sage & Libra 2
|
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.
|
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Still reading
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 14,016
Karma: 105092227
Join Date: Jun 2017
Location: Ireland
Device: All 4 Kinds: epub eink, Kindle, android eink, NxtPaper
|
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. |
![]() |
![]() |
![]() |
#4 |
Junior Member
![]() Posts: 9
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. |
![]() |
![]() |
![]() |
#5 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 13,467
Karma: 239219543
Join Date: Jan 2014
Location: Estonia
Device: Kobo Sage & Libra 2
|
Quote:
Perhaps you should also limit the searched metadata to only those categories you use often. |
|
![]() |
![]() |
Advert | |
|
![]() |
#6 | |
Still reading
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 14,016
Karma: 105092227
Join Date: Jun 2017
Location: Ireland
Device: All 4 Kinds: epub eink, Kindle, android eink, NxtPaper
|
Quote:
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. |
|
![]() |
![]() |
![]() |
#7 | |
Custom User Title
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 10,970
Karma: 75337983
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
|
Quote:
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. |
|
![]() |
![]() |
![]() |
#8 |
Still reading
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 14,016
Karma: 105092227
Join Date: Jun 2017
Location: Ireland
Device: All 4 Kinds: epub eink, Kindle, android eink, NxtPaper
|
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) 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. |
![]() |
![]() |
![]() |
#9 | |
Custom User Title
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 10,970
Karma: 75337983
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
|
Quote:
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. 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. |
|
![]() |
![]() |
![]() |
#10 | |
null operator (he/him)
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 21,721
Karma: 29711016
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
Quote:
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. |
|
![]() |
![]() |
![]() |
#11 |
Custom User Title
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 10,970
Karma: 75337983
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly 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. |
![]() |
![]() |
![]() |
#12 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,444
Karma: 8012886
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
|
|
![]() |
![]() |
![]() |
#13 |
Custom User Title
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 10,970
Karma: 75337983
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
|
Oh I didn't realize. That's good.
|
![]() |
![]() |
![]() |
|
![]() |
||||
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 |