Mass searching for a specific lump within wads?

Discuss anything ZDoom-related that doesn't fall into one of the other categories.
Post Reply
Ribo Zurai
Posts: 873
Joined: Fri Jul 03, 2009 1:47 pm

Mass searching for a specific lump within wads?

Post by Ribo Zurai »

I'm not sure if this is possible, but I was wondering if there's a tool or any sort of method to search within wad/pk3 files for a specific lump by its name. My issue is that I'm looking for a wad in particular which I fiddled with its contents all the way back in 2010, but knowing I accumulate mods over the years I am not sure of its filename, much less if I even got the wad in my possession. (the PC has been replaced but a backup might have survived) I have extracted a sprite and an audio lump from its contents and I still have those in an unwad folder. I have almost 40 gigabytes of wads in my folder, searching each one in Slade is hell. So I would like to know if there's any way to "reverse search" for the wad those lumps belonged to. (or at least any wads that have those lumps within them)
User avatar
3saster
Posts: 199
Joined: Fri May 11, 2018 2:39 pm
Location: Canada

Re: Mass searching for a specific lump within wads?

Post by 3saster »

I would point you to using Python with the Omgifol library. It's a very good and handy library, and I have used it before to do something in the same vein as you; in my case, I used it to download every single wad from idgames that contained a custom STBAR lump (well, I technically downloaded EVERY wad from idgames, then deleted the ones that did not have a custom STBAR lump).
Ribo Zurai
Posts: 873
Joined: Fri Jul 03, 2009 1:47 pm

Re: Mass searching for a specific lump within wads?

Post by Ribo Zurai »

3saster wrote:I would point you to using Python with the Omgifol library. It's a very good and handy library, and I have used it before to do something in the same vein as you; in my case, I used it to download every single wad from idgames that contained a custom STBAR lump (well, I technically downloaded EVERY wad from idgames, then deleted the ones that did not have a custom STBAR lump).
I'm afraid I have no knowledge with Python at all.
User avatar
Rachael
Posts: 13919
Joined: Tue Jan 13, 2004 1:31 pm
Preferred Pronouns: She/Her
Contact:

Re: Mass searching for a specific lump within wads?

Post by Rachael »

I think a far more viable solution, at least for this specific use case, would be some sort of directory enumerator. It's easy enough to use zip tools to enumerate the contents of zip and 7z files, however, you would have to use something like DeuTex to do it for .wad files.

To use DeuTex for this purpose:

Download the release linked on that page. Extract it to a folder. Copy your Doom1/2.wad file to your new DeuTex folder.

This Windows script can use DeuTex to search for a specific lump name:

Code: Select all

@echo off
setlocal
if "%1"=="" echo Must specify search string!
if "%1"=="" goto :eof
for %%I in (*.wad) do call :enumerate "%%~nxI"
find "%~1" *.wad.dir.txt|more
goto :eof
:enumerate
DeuTex -wadir "%~1" > "%~1.dir.txt"
goto :eof
Do note that it generates a bunch of ".wad.dir.txt" files in the active folder when run. If you do not like this, insert "del *.wad.dir.txt" before the "goto :eof" on line 7 to get rid of them when the script is done.

This script must be run from the command prompt. If you want to run it in a different folder where DeuTex is not located, you must change the "DeuTex" line to contain the full path of the DeuTex .exe file, i.e.

Code: Select all

D:\DoomTools\DeuTex\DeuTex.exe -wadir "%~1" > "%~1.dir.txt"
Gez
 
 
Posts: 17938
Joined: Fri Jul 06, 2007 3:22 pm

Re: Mass searching for a specific lump within wads?

Post by Gez »

This Doomworld post may be of interest:
https://www.doomworld.com/forum/post/2242050
Post Reply

Return to “General”