Share your knowledge at the LQ Wiki.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 11-17-2011, 04:08 AM   #1
LQ Newbie
Registered: Nov 2011
Posts: 3

Rep: Reputation: Disabled
Conversion of binary to ascii file

Hello friends,

I am trying to convert a binary file received from mainframes to an ascii file in linux.
I know the length of record in the input file(example: I know the record length is 89)

I am using the below command for conversion

dd if=input_file of=output_file conv=ascii,unblock cbs=89
There are a multiple files which I am working on with different record lengths.

Files are being converted to ascii but issue woth few files.

The record count of teh converted file is greater than the expected count(Aware of what the count would be).

This command works fine with Solaris unix.

Help on this is highly appreciated.

Old 11-17-2011, 06:31 AM   #2
Senior Member
Registered: Apr 2004
Location: Brisbane, Australia
Distribution: pclinuxos slackware64 tails kali
Posts: 3,382
Blog Entries: 33

Rep: Reputation: 217Reputation: 217Reputation: 217
Hi, Welcome to LQ!

LQ has a fantastic search function that may save you time waiting for an answer to a popular question.

With over 4 million posts to search it's possible the answer has been given.

there is also a program "bin2ascii" (ascii comes in many forms, (eg. ascii-latin-1) now-a-days) you may lookup(search).

This may be off base,

Regards Glenn
Old 11-17-2011, 08:19 AM   #3
LQ Newbie
Registered: Nov 2011
Posts: 3

Original Poster
Rep: Reputation: Disabled

I could not find bin2ascii utility in my linux version.

The other option I could not use.
Do u have any other approach to fix this

Old 11-17-2011, 08:33 AM   #4
LQ Addict
Registered: Mar 2010
Location: Oakland,Ca
Distribution: wins7, Debian wheezy
Posts: 6,838

Rep: Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649
Did you try the likes under in the quote from Glen?
Old 11-17-2011, 11:33 AM   #5
LQ Newbie
Registered: Nov 2011
Posts: 3

Original Poster
Rep: Reputation: Disabled
I do not have idea about PYTHON programming.
Also intrested in getting the complete record and not in specific fields.

If you could suggest an alternative in linux itself,that would be helpful



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
Binary to Ascii Conversion Problem towhidgrep Programming 3 11-18-2011 07:24 PM
[SOLVED] Text file conversion problem from Windows to ASCII paullanders Programming 3 06-03-2011 10:49 AM
Convert binary file in to ascii file using shell script scream Linux - Newbie 5 05-24-2011 08:59 PM
[SOLVED] How to convert binary file to ascii file? idaham Linux - Newbie 9 09-18-2009 04:19 AM
Conversion from EBCDIC to ASCII aravindts Programming 2 06-27-2007 04:05 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 03:05 AM.

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