| | |
Parsing Through .bin file assistance
![]() |
•
•
Join Date: Jul 2009
Posts: 1
Reputation:
Solved Threads: 0
Hello everyone,
I've been having a problem parsing through a .bin file. Ideally, I want the script to read the .bin file, find the first word in it, write down word 1 somewhere else, and continue on throughout the file, word by word. I've tried similar things such as
open (MYFILE, 'data.txt');
while (<MYFILE>) {
chomp;
print "$_\n";
}
close (MYFILE);
but it is not effective for the .bin. Any help would be greatly appreciated.
I've been having a problem parsing through a .bin file. Ideally, I want the script to read the .bin file, find the first word in it, write down word 1 somewhere else, and continue on throughout the file, word by word. I've tried similar things such as
open (MYFILE, 'data.txt');
while (<MYFILE>) {
chomp;
print "$_\n";
}
close (MYFILE);
but it is not effective for the .bin. Any help would be greatly appreciated.
•
•
Join Date: Jun 2008
Posts: 49
Reputation:
Solved Threads: 5
•
•
•
•
Hello everyone,
I've been having a problem parsing through a .bin file. Ideally, I want the script to read the .bin file, find the first word in it, write down word 1 somewhere else, and continue on throughout the file, word by word. I've tried similar things such as
open (MYFILE, 'data.txt');
while (<MYFILE>) {
chomp;
print "$_\n";
}
close (MYFILE);
but it is not effective for the .bin. Any help would be greatly appreciated.
It's hard to know how to handle the data if we don't know how it's read in by the script.
•
•
Join Date: Aug 2007
Posts: 165
Reputation:
Solved Threads: 18
If you are using unix/linux or cygwin on winders, use the strings() command, as in This command extracts every sequence of printable characters followed by an unprintable character.
Exercises for the student include working with multi-byte character strings, calling the strings command from within perl, and searching for equivalent functionality in perl.
Perl Syntax (Toggle Plain Text)
strings filename.bin
Exercises for the student include working with multi-byte character strings, calling the strings command from within perl, and searching for equivalent functionality in perl.
![]() |
Similar Threads
- How to extract .rpm files from .bin file (*nix Software)
- How to copy data from serial port to notepad (Visual Basic 4 / 5 / 6)
- Win 98se & bios update with Bin file (Windows 95 / 98 / Me)
- Parsing a .asn file (Community Introductions)
- Hijack this log file, assistance requested (Viruses, Spyware and other Nasties)
Other Threads in the Perl Forum
- Previous Thread: pattern matching
- Next Thread: sort files by date
| Thread Tools | Search this Thread |





