SUBSIM Radio Room Forums



SUBSIM: The Web's #1 resource for all submarine & naval simulations since 1997

Go Back   SUBSIM Radio Room Forums > Silent Hunter 3 - 4 - 5 > SHIII Mods Workshop
Forget password? Reset here

Reply
 
Thread Tools Display Modes
Old 08-09-09, 02:05 PM   #1
Stiebler
Fuel Supplier
 
Stiebler's Avatar
 
Join Date: Oct 2005
Location: London, UK
Posts: 1,237
Downloads: 29
Uploads: 4


Default BigSearch - search within multiple binary files

Have you ever wanted to locate all occurrences of a text string in hundreds of files including binary files? Because you’ve forgotten where you last altered the parameters, and you need to find them again in order to alter them again?

It is not so easy. Any text searcher (including those provided by Microsoft) will locate your text in text files, but not in binary files (nor pdf, html, etc). Equally, any hex editor will enable you to find all occurrences of a text string in a single binary file, but not across hundreds.

Recently, I needed to find all occurrences of ‘Bold’ (all combinations of upper and lower case) across the 24,000 or so files of Silent Hunter III/NYGM. So I wrote a short C++ program to do this.

The program is called BigSearch, and you can download it from my signature below.

It works for searches of binary files and for searches of text files too, so it doubles as a simple finder of texts in ordinary text files. You can also carry out AND, NOT and OR operations, and exclude file types of no interest (such as music or sound files) A short pdf instruction manual is included - please read it first (only 3 pages).

I like all my programs to run very, VERY fast, so BigSearch does too! Pity about the archaic interface, though.

I’ve given BigSearch a good bashing for my own use, and verified its accuracy in locating search items. But doubtless some of you guys out there can find bugs in it. Use at your own risk!

Stiebler.
Stiebler is offline   Reply With Quote
Old 08-09-09, 03:02 PM   #2
Laufen zum Ziel
Eternal Patrol
 
Laufen zum Ziel's Avatar
 
Join Date: Jan 2008
Location: Hiding on the bottom
Posts: 1,783
Downloads: 853
Uploads: 457


Default

Thank you. I will give it a try.
__________________
RIP Laufen zum Ziel
Laufen zum Ziel is offline   Reply With Quote
Old 08-10-09, 10:46 AM   #3
Krabb
Navy Dude
 
Join Date: Apr 2009
Posts: 172
Downloads: 32
Uploads: 0
Default

Interesting program. Thanks!

But Microsoft actually has such text searcher in the command line :
Code:
findstr /s /i /m "string" *
This will search for "string" (case-insensitive) in all files from the current folder and all subfolders and will print the filenames of files containing a match. See program's help ("findstr /?"). It can even use regular expressions for search.
Krabb is offline   Reply With Quote
Old 08-11-09, 04:13 AM   #4
Stiebler
Fuel Supplier
 
Stiebler's Avatar
 
Join Date: Oct 2005
Location: London, UK
Posts: 1,237
Downloads: 29
Uploads: 4


Default

Quote:
But Microsoft actually has such text searcher in the command line :
Code:
findstr /s /i /m "string" *
Now he tells me! I wish I had known that earlier, it would have saved a lot of work. (Don't forget to add ' >> results.txt' - without the quotes - to the findstr line shown above, to save the results obtained.)

However...
Since I *have* now completed my alternative, which is simpler to use (Windows interface), allows extra options and runs faster, I might as well leave 'BigSearch' publicly available to those who want it.

Out of curiosity, I checked the output from the Microsoft version on the SH3/NYGM combination. Both gave identical file hits (allowing for the fact that the Microsoft version has no option to disable the searching of unnecessary tga files), so well done Microsoft!

Stiebler.
Stiebler is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 12:33 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright © 1995- 2025 Subsim®
"Subsim" is a registered trademark, all rights reserved.