LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 07-06-2009, 05:54 PM   #1
acandria17
LQ Newbie
 
Registered: Jul 2009
Posts: 1

Rep: Reputation: 0
Perl Parse .bin file


Hello everyone!

I've got a problem trying to parse through a .bin file. Ive parsed through a txt file already but im having trouble with the .bin since i am unable to read it. Should i somehow convert the bin to ascii before i try anything? If you have any suggestions or thoughts, I am all ears. Thanks in advance!
 
Old 07-07-2009, 12:52 AM   #2
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,356

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
Depends on exactly what the .bin file represents. Normally on Linux its a self-extracting file; ie you give it exe perms and run it:

chmod u+x file.bin
./file.bin

You need to know what it really contains, what format its in. There may well be a pre-written Perl module that will help.
 
Old 07-07-2009, 05:42 AM   #3
j-ray
Senior Member
 
Registered: Jan 2002
Location: germany
Distribution: ubuntu, mint, suse
Posts: 1,591

Rep: Reputation: 145Reputation: 145
if it contains binary data you should not convert that to ascii. As chrism01 said there is a module for binary parsing here
http://search.cpan.org/~audreyt/Pars...arse/Binary.pm
among others...
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
perl parse umbrella2 Programming 4 01-31-2009 08:46 AM
perl script to parse this file ohcarol Programming 10 11-02-2006 09:50 AM
optimizing perl parse file. eastsuse Programming 1 12-22-2004 02:49 AM
Need help with perl/bash script to parse PicBasic file cmfarley19 Programming 13 11-18-2004 05:06 PM
perl(Cwd) perl(File::Basename) perl(File::Copy) perl(strict)....What are those? Baldorg Linux - Software 1 11-09-2003 08:09 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 07:01 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration