--Cool. If you could post your code, it might be of help to others...

Quote Originally Posted by garyng
thanks, the 'grep -b' option only works if the input is considered to be text and in my case it is binary and grep only want to say "match/not match"

Anyway, it seems to be pretty easy in perl so I went that route.