LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
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
Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.5, Centos 5.10
Posts: 16,289

Rep: Reputation: 2034Reputation: 2034Reputation: 2034Reputation: 2034Reputation: 2034Reputation: 2034Reputation: 2034Reputation: 2034Reputation: 2034Reputation: 2034Reputation: 2034
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
Posts: 1,432

Rep: Reputation: 100Reputation: 100
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


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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


All times are GMT -5. The time now is 06:13 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration