In supporting a legacy system, I'm faced with a field data collector that stores data in the following format:
# This is a comment <-beacuse it starts at the begining of the file
# This is a comment <- see above
# 1. Item one <- not a comment because it starts with 1.
# Description of Item 1 <- not a comment as it is after a line that starts with a number
data point 1
data point 2
data point etc
3 <-- represents number of data points under Item one
# 2. Item two <-- not a comment
# Description of item 2 <-- not a comment
data point 1
data point ..
data point 100
100
#3. Item three <--- not a comment
# Item three description
0
I'm not sure what is the correct way to parse for that file to include each Item as its own list. Note that sometimes but not always the data adds a random space between two different items.
What is the correct way to parse such a file?