Mass searching for a specific lump within wads?

Discuss anything ZDoom-related that doesn't fall into one of the other categories.

Mass searching for a specific lump within wads?

Postby Ribo Zurai » Tue Jan 12, 2021 7:32 pm

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
Ribo Zurai
 
Joined: 03 Jul 2009

Re: Mass searching for a specific lump within wads?

Postby 3saster » Tue Jan 12, 2021 8:22 pm

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).
User avatar
3saster
 
Joined: 11 May 2018
Location: Canada

Re: Mass searching for a specific lump within wads?

Postby Ribo Zurai » Tue Jan 12, 2021 8:47 pm

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
Ribo Zurai
 
Joined: 03 Jul 2009

Re: Mass searching for a specific lump within wads?

Postby Rachael » Wed Jan 13, 2021 5:48 am

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 allExpand view
@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 allExpand view
D:\DoomTools\DeuTex\DeuTex.exe -wadir "%~1" > "%~1.dir.txt"
User avatar
Rachael
Webmaster
 
Joined: 13 Jan 2004
Discord: Rachael#3767
Twitch ID: madamerachelle
Github ID: madame-rachelle
Operating System: Windows 10/8.1/8/201x 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: nVidia with Vulkan support

Re: Mass searching for a specific lump within wads?

Postby Gez » Wed Jan 13, 2021 8:19 am

This Doomworld post may be of interest:
https://www.doomworld.com/forum/post/2242050
Gez
 
 
 
Joined: 06 Jul 2007


Return to General

Who is online

Users browsing this forum: TiberiumSoul and 5 guests