Parse a text with selfdescribing rules [message #1733387] |
Thu, 26 May 2016 23:54 |
Mihai Traistariu Messages: 6 Registered: March 2016 |
Junior Member |
|
|
Hi,
How can I parse the content of the file when I have the structure of the following elements described in a header?
Let's say I want to have "person tables" where the first line contains :
- how many elements will follow
- the length of the FirstName field
- the length of the LastName field
- the length of Age field
- the length of Address field
To be more complicated, some elements might not have the full length (for example the Address field is missing or incomplete).
Here is an example of such file (there is one space between element's fields) :
2 FirstName 10 LastName 10 Age 3 Address 50
Jon Snow 28 Castle Black
Ayra Stark 15 Bravos
1 LastName 12 FirstName 12 Age 3 Address 50
Lannister Tyrion 30
Thank you
[Updated on: Thu, 26 May 2016 23:56] Report message to a moderator
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03378 seconds