How can I read a structured data file in Julia?
Speaking in python, if I have defined some c-styled format:
df = [
['Label', '4s'],
['Version', 'i'],
['Revision', 'i'],
['Date', '28s'],
['FileFormat', '2i'],
['FileType', '4s'],
['OriginalFileName', '68s'], ...etc]
df
is parsed out into var_names and structure and then read:
fh = open(fn,'rb')
data = fh.read()
header = struct.unpack_from(struct_format, data[0:structsize])
I can't figure out how to do something equivalent in Julia.
In a somewhat similar question, I see how I could build a type to handle this but have yet to figure out how a variable can have a specific amount of base types; 4 ints for example.
I've read all the documentation I can find on sprint and its cousins, but haven't found any examples to help make sense of the them.