Utility grep

View: New views
2 Messages — Rating Filter:   Alert me  

Utility grep

by James-384 :: Rate this Message:

| View Threaded | Show Only this Message

Hi,

I  was looking for a tool that could find a string (pattern) in a file
and return the startposition of each occurence.

I tested GREP with the -b option

It  works fine if the file is a text file, but it does not returns the
binary  position  of the searchpattern, but the binary position of the
beginning of the LINE where it is part of ...

Furtermore,  if  the  file  is an EXE, so a real binary file and not a
text file with lines, this does not work.

If  I  use the parameter "-c", I get the correct number of occurences.
But  without  this  parameter,  it just says "Binary file filename.exe
matches"

Is  it  not  possible  to get the startposition of each occurence of a
pattern in a non text file ?


James
mailto:jamesvdb@...



Re: Utility grep

by Paul Eggert :: Rate this Message:

| View Threaded | Show Only this Message

Perhaps you want the -a option?