Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

ArtOfWarfare

macrumors G3
Original poster
Nov 26, 2007
9,558
6,058
I'd like a utility that acts kind of like

Code:
hexdump -c

But instead of mixing in the ASCII with everything else, I'd like it to only print the ASCII.

It could have a bit of intelligence, only considering something to be ASCII if it's part of a sequence that contains at least two alphanumeric ASCII characters.

Then I would like it to insert line breaks between each sequence when it outputs it.

I'd like this utility so that I can easily find all the ASCII strings any file contains (specially, I'd like to see what strings a .mpg contains and what a .dll contains - I'm trying to find a way of determining what codecs the .dll file recognizes, and I'm hoping that it involves some ASCII strings.)
 

ArtOfWarfare

macrumors G3
Original poster
Nov 26, 2007
9,558
6,058
Code:
man strings

Thanks. I had worked out an algorithm and started writing it in C but stopped when I saw your post. Interestingly, it looks like the algorithm they used produced the exact same results as mine (or at least my algorithm wouldn't have removed anything there's didn't.)

I was assigning point values to characters. Symbols got 1 and alphanumeric got 2... everything else got 0. Contiguous sections of symbols and alphanumeric that added up to at least 4 would get printed, and a line break would be entered when it swapped from printing to not printing.

But it looks like I need not implement it because someone else already did. Thanks!
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.