HI I'm new to this forum
I'm having a peculiar problem
I'm trying to read a 64 bit data binary file
I have 5 integer variables a b c d e
the problem is I have to read the 64 bit data
like 0-7 bits as integer value to a
8-15 bits as int into b
16-18 bits as int into c
etc like that
for eg if 0-7 bits are 0011010 then a should be a int value of 26
my format of binary file looks like the following
00000000 070E0000160A04C 0 031000000F01028 0 .......À....... €
00000010 0A090000131401C 0 1E1700001A0601C 0 .......À....... À
00000020 1A0B05001E1701C 0 18110100031603C 0 .......À....... À
00000030 090C0000130001C 0 00120700140E03C 0 .......À....... À
00000040 18150500010E038 0 0B160600160602C 0 .......€....... À
00000050 0A0E0000130B01C 0 19010100050803C 0 .......À....... À
00000060 1B0801000C0F03C 0 011607001D1303C 0 .......À....... À
so in the first line I'm interested only in 070E0000160A04C 0 since this is the 64 bit data
so for the binary file I set the hex line length as 8 and the view changes to
lsb msb
00000000 070E0000160A04C 0 .......À
00000008 031000000F01028 0 .......€
00000010 0A090000131401C 0 .......À
00000018 1E1700001A0601C 0 .......À
00000020 1A0B05001E1701C 0 .......À
00000028 18110100031603C 0 .......À
00000030 090C0000130001C 0 .......À
Which format you think will be better
I'm completely new to reading binary files or binary format itself
Can you please let me know how to read specific bits to a specific variable
A code sample would be of great help
Thank you
I'm having a peculiar problem
I'm trying to read a 64 bit data binary file
I have 5 integer variables a b c d e
the problem is I have to read the 64 bit data
like 0-7 bits as integer value to a
8-15 bits as int into b
16-18 bits as int into c
etc like that
for eg if 0-7 bits are 0011010 then a should be a int value of 26
my format of binary file looks like the following
00000000 070E0000160A04C 0 031000000F01028 0 .......À....... €
00000010 0A090000131401C 0 1E1700001A0601C 0 .......À....... À
00000020 1A0B05001E1701C 0 18110100031603C 0 .......À....... À
00000030 090C0000130001C 0 00120700140E03C 0 .......À....... À
00000040 18150500010E038 0 0B160600160602C 0 .......€....... À
00000050 0A0E0000130B01C 0 19010100050803C 0 .......À....... À
00000060 1B0801000C0F03C 0 011607001D1303C 0 .......À....... À
so in the first line I'm interested only in 070E0000160A04C 0 since this is the 64 bit data
so for the binary file I set the hex line length as 8 and the view changes to
lsb msb
00000000 070E0000160A04C 0 .......À
00000008 031000000F01028 0 .......€
00000010 0A090000131401C 0 .......À
00000018 1E1700001A0601C 0 .......À
00000020 1A0B05001E1701C 0 .......À
00000028 18110100031603C 0 .......À
00000030 090C0000130001C 0 .......À
Which format you think will be better
I'm completely new to reading binary files or binary format itself
Can you please let me know how to read specific bits to a specific variable
A code sample would be of great help
Thank you
Comment