473,397 Members | 2,077 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,397 software developers and data experts.

Binary files

hi guys,
I am having problem reading binary file ? I dont know what is written
inside the binary file ( prob numbers) , but i tried so many times with
different parameters but not able to get the output... any idea??

Feb 26 '06 #1
6 1287
kate2006 <ka**********@yahoo.co.uk> wrote:
I am having problem reading binary file ? I dont know what is written
inside the binary file ( prob numbers) , but i tried so many times with
different parameters but not able to get the output... any idea??


Without seeing any of your code, or knowing what problem you're
actually encountering, we can't possibly tell.

Could you post a short but complete program which demonstrates the
problem?

See http://www.pobox.com/~skeet/csharp/complete.html for details of
what I mean by that.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too
Feb 27 '06 #2
Hi Kate,

Are you using a stream to read it?

Bernie Yaeger

"kate2006" <ka**********@yahoo.co.uk> wrote in message
news:11**********************@e56g2000cwe.googlegr oups.com...
hi guys,
I am having problem reading binary file ? I dont know what is written
inside the binary file ( prob numbers) , but i tried so many times with
different parameters but not able to get the output... any idea??

Feb 27 '06 #3
Hi Bernie,

Good to see you back. However in the way you are answering was once the
reason that I changed my Nick to Corrina when I had a problem.

:-)

Cor

"Bernie Yaeger" <be*****@optonline.net> schreef in bericht
news:er**************@TK2MSFTNGP09.phx.gbl...
Hi Kate,

Are you using a stream to read it?

Bernie Yaeger

"kate2006" <ka**********@yahoo.co.uk> wrote in message
news:11**********************@e56g2000cwe.googlegr oups.com...
hi guys,
I am having problem reading binary file ? I dont know what is written
inside the binary file ( prob numbers) , but i tried so many times with
different parameters but not able to get the output... any idea??


Feb 27 '06 #4
I am trying to read a file written in binary format !!! through this
code i can execute hex coding of file and convert it in binary ..but i
found out that the file contain signed character(128), how can i come
up with signed value...

thanx

Dim fs As FileStream = New FileStream(txtbrowse.Text, FileMode.Open)
Dim w As BinaryWriter = New BinaryWriter(fs)
Dim r As BinaryReader = New BinaryReader(fs)

Dim MySize As Long
MySize = FileLen(txtbrowse.Text)
Dim p as integer
Dim ar() As Integer
Dim s As Integer
Dim s1 As String

For p = 0 To MySize
s = r.ReadByte
s1 = Convert.ToInt32(s)
ListBox1.Items.Add(s1)
Next
fs.Close()

Feb 27 '06 #5
kate2006 <ka**********@yahoo.co.uk> wrote:
I am trying to read a file written in binary format !!!
*What* binary format though? Saying that the file is written in "binary
format" is like saying that a book is written in "a language".
through this
code i can execute hex coding of file and convert it in binary ..but i
found out that the file contain signed character(128), how can i come
up with signed value...


Firstly, don't confuse characters with bytes. If this is a binary file,
characters shouldn't come into it.

It would really help if you'd give us a short but *complete* example
program that demonstrates the problem, along with a sample of the data
and what you'd expect to get back.

As I said before, read http://www.pobox.com/~skeet/csharp/complete.html

Your current code is reading a byte at a time, but we've no idea what
you *want* to be reading, or how that data is formatted.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too
Feb 27 '06 #6
guy
do you know what to expect when reading the file? if not you are in for a lot
of detective work work usng a binary editor trying to work out what is there
- and that is mainly down to experience. If this is the case dump some of the
file and i will have a look at the w/e

gu**********************@hotmail.com
--guy--
"kate2006" wrote:
hi guys,
I am having problem reading binary file ? I dont know what is written
inside the binary file ( prob numbers) , but i tried so many times with
different parameters but not able to get the output... any idea??

Feb 28 '06 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

27
by: Eric | last post by:
Assume that disk space is not an issue (the files will be small < 5k in general for the purpose of storing preferences) Assume that transportation to another OS may never occur. Are there...
28
by: wwj | last post by:
void main() { char* p="Hello"; printf("%s",p); *p='w'; printf("%s",p); }
9
by: Ching-Lung | last post by:
Hi all, I try to create a tool to check the delta (diff) of 2 binaries and create the delta binary. I use binary formatter (serialization) to create the delta binary. It works fine but the...
8
by: dagecko | last post by:
Hi I would like to know how to detect if a file is binary or not. It's important for me but I don't know where to start. Ty
10
by: joelagnel | last post by:
hi friends, i've been having this confusion for about a year, i want to know the exact difference between text and binary files. using the fwrite function in c, i wrote 2 bytes of integers in...
68
by: vim | last post by:
hello everybody Plz tell the differance between binary file and ascii file............... Thanks in advance vim
3
by: nicolasg | last post by:
Hi, I'm trying to open a file (any file) in binary mode and save it inside a new text file. After that I want to read the source from the text file and save it back to the disk with its...
15
by: JoeC | last post by:
I am writing a program that I am trying to learn and save binary files. This is the page I found as a source: http://www.angelfire.com/country/aldev0/cpphowto/cpp_BinaryFileIO.html I have...
3
by: masood.iqbal | last post by:
Hi, Kindly excuse my novice question. In all the literature on ifstream that I have seen, nowhere have I read what happens if you try to read a binary file using the ">>" operator. I ran into...
9
by: deepakvsoni | last post by:
are binary files portable?
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.