now I can parse through and get the ascii
That makes it sound like you want to read through a file that contains both "printable" and "non-printable" byte values, and display only the printable (ascii) stuff. On unix, there is a command called "strings" to do exactly that.
A perl implementation would be something like this (assuming the file is not too big to hold in memory):
$_ = do { local $/; <> };
s/[^\t\n\r -~]+/\n/g;
print;
You could tweak that to print only strings that are some minimum length, etc. Anything else you know about the binary file (e.g. strings of interest are all terminated by null bytes, or something like that) could be used to good effect in making sure you only print the interesting parts. |