trying to convert binary data to text using C++


 
Thread Tools Search this Thread
Top Forums Programming trying to convert binary data to text using C++
# 1  
Old 09-04-2008
trying to convert binary data to text using C++

i hav tried to convert binary 2D data into text using binreader and writing into text file using streamwriter.
i use ReadSingle() function to convert from binary to ascii, although it works good in 1D data but not in more dimensions.

the kind of values i get are
-1.265369923E+038
and like

i dont understand what is the problem??
# 2  
Old 09-04-2008
We cannot guess what values you should be getting, although we can sort of infer from the description that -1.265369923E+038 is probably somehow wrong. What's the input like and what would you like the output to be like?
# 3  
Old 09-05-2008
trying to convert binary data to text using C++

my input is binary or rather machine language symbols.. like #,@ etc
and i expect floating numbers as output like 0.321etc

i have used ReadSingle(), ReadBytes(), ReadDouble(), ReadDecimal()...
all of them seem to be giving nonsense values

can i get a code for it???
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Read csv file, convert the data and make one text file in UNIX shell scripting

I have input data looks like this which is a part of a csv file 7,1265,76548,"0102:04" 8,1266,76545,"0112:04" I need to make the output data should look like this and the output data will be part of text file: 7|1265000 |7654899 |A| 8|12660000 |76545999 |B| The logic behind the... (6 Replies)
Discussion started by: RJG
6 Replies

2. Shell Programming and Scripting

How to convert Text data to xls?

Hi Team, I have created a script to output DB Query data to a text file. It displays output as follows for 2 different queries appended to same file. I want help to convert this data to xls format so that the output of first query is in 1 tab and the other in second tab. Please help. ... (14 Replies)
Discussion started by: srkmish
14 Replies

3. Shell Programming and Scripting

Convert binary file to csv and then back to the binary format

Hello *nix specialists, Im working for a non profit organisation in Germany to transport DSL over WLAN to people in areas without no DSL. We are using Linksys WRT 54 router with DD-WRT firmware There are at the moment over 180 router running but we have to change some settings next time. So my... (7 Replies)
Discussion started by: digidax
7 Replies

4. Shell Programming and Scripting

Convert binary to text Perl script

Hello everyone, I have a binary file with a structure unknown. I have found 2 perl scripts that it seems to do the convertion but I get sintactic errors when I run them, may somebody test these 2 scripts please and see if really work? One if from here... (10 Replies)
Discussion started by: Ophiuchus
10 Replies

5. AIX

Convert clear text into binary

Hi I need to display the binary text of an clearn text which is sent as input to the shell script (c shell); ex: I will pass "HELLO" as input, and i should get the binary format of the text Thanks in advance Mohan (1 Reply)
Discussion started by: mKarri
1 Replies

6. Shell Programming and Scripting

convert binary file into text file

im looking for anothr way to convert binary file into text file im using old solaris version (exatcly like xxd -r) thanks (2 Replies)
Discussion started by: modcan
2 Replies

7. UNIX for Dummies Questions & Answers

How to convert binary Unix file to text

Hi all, I have a print control file (dflt) for Oracle which is in binary. As I am going to develope an application in Window environment, I would like to reference the dflt file. But it is in binary format and I cannot access it. Anyone can suggest me how to convert the file into text or... (5 Replies)
Discussion started by: user12345
5 Replies

8. UNIX for Dummies Questions & Answers

Binary data to text file conversion

Dear Sir; i want to know how the binary data convert to text file or readablw format (ASCII).If possible pl. help me for the software and where it is available for download. i.e. (1 Reply)
Discussion started by: auro123
1 Replies

9. UNIX for Advanced & Expert Users

Convert Binary data to ascii data

Friends, I've tried on solaris, but I could n't get ascii data dd if=binaryinputfile bs=1 skip=3800 count=4 | od -t u4 output : INDBU3:/usr/users/FTAMUSER/kk $ dd if=SMP20041006173649188151 bs=1 skip=3800 count=4 | od -t u4 4+0 records in 4+0 records out 0000000 0000000000 0000004... (4 Replies)
Discussion started by: krishna
4 Replies

10. UNIX for Advanced & Expert Users

Convert ASCII to BINARY

Here is what I did . . . . I FTP'd several *.pdf files from a web site to a UNIX server, and did not set the transfer mode to BIN, now Adobe thinks that the documents are corrupted. Is there a way to convert the *.pdf files to Binary so that Adobe can open them again. I would just re-download... (2 Replies)
Discussion started by: pc9456
2 Replies
Login or Register to Ask a Question