How can I read a file that consists of a line (string of 10 csv) of numbers and text and then after this line, there are 4096 bytes?
Something like this:
117,47966,55,115,223,224,94,0,28,OK:
\00\00\00\F6\FF\EF\FFF\00\FA\FF\00\CA\FF\009\00Z\00\D9\FFF\00\E3\FF?\00\F0\FF\00\B1\FF\9D\FF\00:\00b\00\E9\FF*\00:\00\00)\00\D3\FF,\00\C6\FF\D6\FF2\00\00!\00\00\00\FE\FF\BA\FF[\00\E8\FF.\00\F7\FF\F9\FF\E6\FF\00\D3\FF\F8\FF\00&\00\
In the past, I've been using ConstBitStream to read pure binary files. I was wondering how can I read line by line and every time I find 'OK:', use ConstBitStream to read the following 4096 bytes?
with open(filename, encoding="latin-1") as f:
lines = f.readlines()
for i in range(1,len(lines)):
elements = lines[i].strip().split(',')
if(len(elements)==10):
readNext4096bytes()