Quantcast
Channel: VBForums - Visual Basic 6 and Earlier
Viewing all articles
Browse latest Browse all 21090

huge binary file to Text file

$
0
0
Hello All
I am new to VB and would like to convert a bonary file to text file.
Basically its data sampled over 20ms from around 5 analong channels collected over 3 days.
I understand that i can use the Get statement to read out the binary file, but the problem
is that in some variables, the size of the data is actualy stored in the immdiate last variables and so i thought i need multiple
Get statements..

The binary file that is arranged as under.
Variable Size Bytes Data Type
MAIN-HEADER
HeaderSize 8 Int64
NameSize 4 Int32
Name NameSize Array of Char (1Byte)
StartTime 8 Int64
EndTime 8 Int64
ChannelCount 4 Int32

Variable Size (Bytes) DataType
Channel -Header #1
ChannelHeaderSize 8 Int64
NameSize 4 Int32
Name NameSize Array of Char (1Byte)
NetIdSize 4 Int32
NetId NetIdSize Array of Char (1Byte)
Port 4 Int32
Sample Time 8 Int64
SymbolBased 1 bool (as byte)
SymoblNameSize 4 Int32
Symbolname: SymbolNameSize Array of Char (1Byte)
CommentSize 4 Int32
Comment CommentSize Array of Char (1Byte)
IndexGroup 8 Int64
IndexOffset 8 Int64
DataTypeSize 4 Int32
DataType DataTypeSize Array of Char (1Byte)
DataTypeId 4 Int32
VariableSize 4 Int32
Samples in File 8 Int64
Data in File 8 Int64
File-StartPosition 8 Int64

Variable Size (Bytes) DataType
Data Channel #1
DataPoint #1
Timestamp 4 UInt32
Value ChannelHeader1.VariableSize ChannelHeader.DataType

DataPoint #2
Timestamp 4 UInt32
Value ChannelHeader1.VariableSize ChannelHeader.DataType

and so on..

Can someone suggest an effective way to it. It would of great help.

Thanks

Viewing all articles
Browse latest Browse all 21090

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>