Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.
convert a binary file to ascii
Name: jkps Date: May 4, 2004 at 04:22:58 Pacific OS: windows XP CPU/Ram: Solaris
Comment:
Hi all, I was editing my c++ file in sun-solaris and then when i ran the make file i got an error saying some junk char not defined in the file,later when i opened i found my C++ file that iw as eidting was full of junks,i guess it wud have been changed to a binary file?
Can anybody helpo me out in converting the file to ascii format?? This is very urgent !!!!!!!!
Name: jaivrat Date: June 3, 2004 at 20:36:33 Pacific
Reply:
Hi,
This reply is two days late. I do not know if it is usefull now. but still:
First thing to do: You can see what junk charactres have invaded your file by giving command
$ cat -v youfilename.cpp > exposed.cpp
then you can see in the exposed.cpp by vi editor or anything to see the junk characters . If there are only a few then you can delete them
But if they are so many then you have to wite a c program which reads file charcter by character and writes it to another file ONLY IF that character is a PRINTABLE character.
You check whether the character is printable using a C library function defined in /usr/include/ctype.h
Summary: Those commands may be useful, but what I'm really trying to do is compile c code in UNIX which can convert a binary datafile to ASCII. From there, I can use winRAR to extract the data for viewing. Any...
Summary: Hi, I have a command line tool that takes a binary file as an argument and produce a text-based file. (For example % myapp -rt file.bin). I want to make this tool available online so that the user co...