[X-Unix] Re: How does one find a string in a binary file, etc.?

Peter Dyballa Peter_Dyballa at Web.DE
Tue Sep 2 14:51:37 PDT 2008


Am 02.09.2008 um 14:59 schrieb Aaron:

> Also, If I can figure out how to sequentially convert each 4-KB  
> block from a large file into a separate file that can be tested  
> (and either saved or discarded), it would make the whole process  
> even easier.
>
> Equivalently, I would go through the large file and test at each 4- 
> KB boundary for the presence of the desired string and, if it was  
> found, I would copy the 4-KB chunk beginning at that point to a new  
> file.

The commands strings and grep can determine whether a large file has  
a hit. The commands split (or csplit?) can produce small files of  
exactly 4 KB size from the interesting large one. If the (small or  
large) file has no hit, remove it.

--
Greetings

   Pete

Make it simple, as simple as possible but no simpler.
				– Albert Einstein





More information about the X-Unix mailing list