Results 1 to 4 of 4
- 05-09-2009, 07:43 PM #1
Member
- Join Date
- Sep 2008
- Location
- Ankara-TURKEY
- Posts
- 42
- Rep Power
- 0
[SOLVED] how to reading binary file and writing txt file
I try to read a binary file and try to write index(an int array) of that binary file into a txt file. I write the txt file but it is not as I expect. For example I read 123(int array ={1,2,3}) from the binary file an write it into the txt file. It writes something like that "dop". I would like to write "123" into txt file not "dop". Could anyone tell me how can I fix that problem.
Kind Regards.A stitch in time saves nine:D
-
Hello,
Could you post a snippet of your code that reads in from the binary file and tries to write it to the text file. I have a feeling that you're code is changing the numbers read in into chars which is not what you want to do, but I can't say for sure without seeing what you are doing.
Best of luck
- 05-09-2009, 11:01 PM #3
Member
- Join Date
- Sep 2008
- Location
- Ankara-TURKEY
- Posts
- 42
- Rep Power
- 0
I found yhe problem
I am so stupid:) I found my problem.
What I tried:
out.write(number[d-1]);
Correct one:
out.write(" "+number[d-1]+" "+"\r\n");
I think, there should be extra argument like space or "":)
thank you for helping.A stitch in time saves nine:D
-
Similar Threads
-
Reading and writing to a file
By jigglywiggly in forum New To JavaReplies: 13Last Post: 03-09-2009, 10:44 AM -
Reading a Field in a Binary File
By janakiram.attuluri in forum Advanced JavaReplies: 2Last Post: 01-09-2008, 10:47 AM -
Reading Binary File and Changing data
By janakiram.attuluri in forum Advanced JavaReplies: 1Last Post: 12-21-2007, 10:10 AM -
reading a binary file with a RAF
By jkurth in forum Advanced JavaReplies: 2Last Post: 12-20-2007, 07:30 AM -
Help with File reading and writing
By baltimore in forum New To JavaReplies: 1Last Post: 07-31-2007, 06:47 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks