0

I have to design a parser to convert Binary(HEX) File into number. I have to refer a format file for the same which is as follows:

(Sr No;field_name;position;length;datatype;flag;)
1;TimeStamp;0;4;HEXA;0;
2;TimeOffset;4;4;HEXA;1;
3;Data_Vol;8;4;HEXA;1;

................so on.........it has 60 fields, which represent 1 record.

Binary file:
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000

Can you please help me coding this C program?

3
Contributors
4
Replies
5
Views
10 Years
Discussion Span
Last Post by jephthah
0

Sure, show us how you would begin with reading your format file to
- read each line
- tokenise the line at each ;
- print the value of each token

0

> 1;TimeStamp;0;4;HEXA;0;
True or false.
This information is in a text file you're supposed to read first, before processing the binary file?

0

it looks to me like you're supposed to create a header file according to a specific format (partially described above) based on attributes of the binary or hex file in question.

is that right?

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.