473,396 Members | 1,766 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,396 software developers and data experts.

Reading Data File, Need Hex Values

Ron
I need a way to read the hex values of an old DBase3 data file.

Can anyone give me some info regarding how to grab hex values out of a file?
Not sure exactly how to do this.

Thanks for your help.
Nov 15 '05 #1
3 2195
Ron <ro*@razorvision.net> wrote:
I need a way to read the hex values of an old DBase3 data file.

Can anyone give me some info regarding how to grab hex values
out of a file?


What *exactly* do you mean by "the hex values"? I would expect a
database such as DBase3 to have a fairly complicated format... do you
have information about it?

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet/
If replying to the group, please do not mail me too
Nov 15 '05 #2
Ron
I need to view/modify the hex code of the file. DBase3 isn't very
complicated, I have a map of the byte sequences and what they mean, I just
need to get at the numbers so I can parse it and make a few changes.

Here is a the DBase3 key:

Byte Description
0 03h, version number
1-3 Last update, YY, MM, DD
4-7 number of records, 32 bit integer
8-9 length of the header structure, 16 bit integer
10-11 length of a record, 16 bit integer
12-31 reserved
32-N Field Descriptors
This is an array of 32-byte descriptors, one for each field in the
record, up to 128 fields.
Byte Description
0-10 Field Name (padded with nul)
11 Field Type
C Character
N Numeric (-.0123456789)
L Logical (YyNnTtFf) (? if not initialized)
D Date (YYYYMMDD)
M memo
12-15 reserved
16 Field Length
17-31 reserved
N+1 0Dh field terminator
So if anyone can tell me how to open a file and read the hex values therein
I would be very appreciative.

Thanks for your input,

Ron

"Jon Skeet" <sk***@pobox.com> wrote in message
news:MP************************@news.microsoft.com ...
Ron <ro*@razorvision.net> wrote:
I need a way to read the hex values of an old DBase3 data file.

Can anyone give me some info regarding how to grab hex values
out of a file?


What *exactly* do you mean by "the hex values"? I would expect a
database such as DBase3 to have a fairly complicated format... do you
have information about it?

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet/
If replying to the group, please do not mail me too

Nov 15 '05 #3
Ron <ro*@razorvision.net> wrote:
I need to view/modify the hex code of the file. DBase3 isn't very
complicated, I have a map of the byte sequences and what they mean, I just
need to get at the numbers so I can parse it and make a few changes.


In that case I suggest you just use a BinaryReader - or even just a
Stream, where you can read the bytes directly.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet/
If replying to the group, please do not mail me too
Nov 15 '05 #4

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

Similar topics

7
by: Santah | last post by:
hi I'm new to C++ and I'm currently working on Visual C++ 6.0 I'm trying to open a text file, and read some data from it part of the text file looks like this: --------
1
by: fabrice | last post by:
Hello, I've got trouble reading a text file (event viewer dump) by using the getline() function... After 200 - 300 lines that are read correctly, it suddenly stops reading the rest of the...
3
by: Sobhan | last post by:
Hi all, I am writing a program in C++ in which I need to read a data file and export to the excel.The Data in the file in CSV format. Values in the .txt file are as follows: "a","b","c"...
8
by: Darsant | last post by:
I'm currently reading 1-n number of binary files, each with 3 different arrays of floats containing about 10,000 values a piece for a total of about 30,000 values per file. I'm looking for a way...
4
by: dale zhang | last post by:
Hi, I am trying to save and read an image from MS Access DB based on the following article: http://www.vbdotnetheaven.com/Code/Sept2003/2175.asp Right now, I saved images without any...
8
by: junk5 | last post by:
Hi I need to read raw 16 bit data from a file, where the first byte is the most significant byte of the first data value and the second byte is the least significant byte of the first data value...
6
by: arne.muller | last post by:
Hello, I've come across some problems reading strucutres from binary files. Basically I've some strutures typedef struct { int i; double x; int n; double *mz;
11
by: Freddy Coal | last post by:
Hi, I'm trying to read a binary file of 2411 Bytes, I would like load all the file in a String. I make this function for make that: '-------------------------- Public Shared Function...
13
by: swetha | last post by:
HI Every1, I have a problem in reading a binary file. Actually i want a C program which reads in the data from a file which is in binary format and i want to update values in it. The file...
6
by: efrenba | last post by:
Hi, I came from delphi world and now I'm doing my first steps in C++. I'm using C++builder because its ide is like delphi although I'm trying to avoid the vcl. I need to insert new features...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
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,...

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.