I need to read a binary file in python for which I have a Matlab code already. I'm converting line by line of matlab code to python but stuck at this place, where I'm reading text data from binary file but the output is not in readable text format. Looking for below Matlab's equivalaent code in python
tried struct module in python to unpack but the output string is not readable straight away into a list
Matlab code:
var = char(fread(fid,100,'char'))';
Python code that I tried:
tmp = f.read(100)
abc, = struct.unpack('100c',tmp)
But value of 'abc' is not regular text string, instead it is something like b'/val1 val2 val3 val4'
I need to get the val1, val2, val3, val4 as strings in to a list