![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| UNIX for Advanced & Expert Users Expert-to-Expert. Learn advanced UNIX, UNIX commands, Linux, Operating Systems, System Administration, Programming, Shell, Shell Scripts, Solaris, Linux, HP-UX, AIX, OS X, BSD. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| ascii to ebcdic conversion | er_ashu | Shell Programming and Scripting | 1 | 02-01-2008 05:43 PM |
| ascii to binary conversion in sco 5.0.5 | sameek1211 | SCO | 1 | 12-17-2007 07:49 AM |
| ascii conversion | rintingtong | Shell Programming and Scripting | 0 | 04-15-2004 01:18 PM |
| ASCII file | sherbet808 | UNIX Desktop for Dummies Questions & Answers | 1 | 06-13-2003 10:46 PM |
| binary to ascii conversion | jimcook42 | UNIX for Dummies Questions & Answers | 2 | 10-10-2001 02:29 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
File conversion to ascii
Hi All,
I have a data file which has binary and hexa decimal data..i tried to convert that file using dd and od commands but i am getting some numbers and junk values... Please let me know is there any other command which can convert this file to ascill. Awaiting your responses -Mora |
|
||||
|
If you know how the file was created, it is probably faster to write a program in the same language, to read the current file and convert the fields to ascii and then create a new output file which is all text.
If you don't know how the file was created, then you have first to decide where each field starts and ends, how to translate each field, whether there are negative numbers, and what is the record separator (if any). "hd" will help with this. It is also possible that there is data compression/encryption in the record, in which case you will only be able to read the file with the software that created it. |
|
||||
|
Hello Jgt,
Thanks for your quick response. The file was created in binary mode and ftp ed to our unix box. The file is fixed width file and it has no negative numbers. There are no data compressions as far as i know.. Pls give me little more details about hd command..that will be helpfull -Mora |
|
||||
|
I'm not sure where you are going with this... What will it accomplish to convert a file containing legitimate 8-bit characters into pure 7-bit representations?? Is this what you mean by ASCII (really "text"), the first 128 characters of the 256 character UTF-8 set character set???
To do the above requires that 8-bit characters be represented as 2 7-bit characters. One very early way of doing this (for file attachments when there was no other way to "attach" binary files to email) was/is called uuencode (and uudecode to change it back to original form). Your unix system will have some man pages on this program. But again I'm not sure what you are really talking about. If this was a regular TEXT file transmitted in BINARY mode by mistake then the only thing you might have to do is translate line endings -- CR/LF [windows] to LF [unix] for example. If that is what is going on you could use a simple sed script to strip CR (ascii character 13, 0d in hex)... |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|