Reading data from file without using format specifier

I write a whole structure into a file and now i want to get back data from file in the same data types used in the structure but the scan should not depend on the elements in the structure.i.e even if i add or erase any element from my structure i should not edit anything in scan function.The changes must get automatically updated and printed back.
Thanks in advance

In reply to vigneshadiththan:

You should be able to write your data as a stream of bits or bytes, known as packing, and read it back into a structure, known as unpacking. SystemVerilog supports this with two constructs: Section 6.24.3 Bit-stream casting, and Section 11.4.14 Streaming operators (pack/unpack).

If this does not answer your question, you’ll need to provide more details about the structures you have.