[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Grep on dictionary words



On Sat, Nov 28, 2009 at 7:13 AM, Dotan Cohen <dotancohen@gmail.com> wrote:
> I have a long binary file (about 12 MB) that I need to extract the
> text from via "strings". Naturally, there are a lot of junk lines such
> as these:
> pDuf
> #k0H}g)
> GoV5
> rLeY1
> TMlq,*
>
> Is there a way to grep the output of strings in order to only show
> lines that contain words found in the aspell dictionary? Thanks in
> advance.


I typically use something like:

strings -n 5

And that removes most of the noise.  Typically the strings I'm looking
for tend to be longer, so if I miss the occasional short text, I'm OK
with that.


Another option might be to do something like:

look '' | grep .. > dict.txt   # get rid of all single letter words
strings logfile | fgrep -f dict.txt


mrc


Reply to: