I have the code below to read a binary file one byte at a time.
The issue is the binary is divided by blocks from that I would like to get some patterns from each block of data and print the
data for each block in a single row. Each block begins with ff77, so initially I would like to know if it is possible to use Regex
to use ff77 as line separator and read one block at a time and print first block in row 1, block 2 in row2 and so on, to avoid
overload the buffer.
If regexp could be used, maybe it could be possible to get some sequences from each block.
This is the code I have so far (binary.txt attached).
Sub Readbin() Dim File, Temp As Byte, i, j File = FreeFile Open "C:\binary.txt" For Binary Access Read As File Do While Not EOF(File) Get File, , Temp If (j Mod 32) <> 0 And j <> 0 Then j = j + 1 Else i = i + 1: j = 1 End If Cells(i, j) = Hex(Temp) Loop Close File End Sub
Thanks in advance for any help.