Extracting a field from a data file
Posted on 2004-10-15
I am now writing a program to extract fields from a data.
Now I am experiencing problems to store the bytes read from the file into appropriate fields.
Since the file is not properly aligned, so I have to skip 0x09 and 0x0A character and 0x32 (which is space) as well everytime I read a byte from the file.
When I read the byte and pass it to the function to store in a field, the byte is not stored in appropriate fields since each field has different number of bytes.
I tried solving this problem by using
extract_data << record.data1 << rercord.data2 << record.data2 ...
This works fine except when the particular record has a "blank" field.
What other options can I go for?