M
Mike Copeland
I'm looking for a technique to parse a series of numeric values from
a line of input. For example, I have the following data lines:
1 2 37 36 4 7 5 6 8 9 10 20 16
601 1100 11 3900 0 0 Starting Values
I want to extract the numeric values from each line, but as can be
seen there are different numbers of values and one line has non-numeric
data that I wish to ignore. Currently I use strtok to (laboriously)
work through each data line, but I assume there must be better ways to
extract such data (and store it into an array or STL container) than
that.
Any thoughts? TIA
a line of input. For example, I have the following data lines:
1 2 37 36 4 7 5 6 8 9 10 20 16
601 1100 11 3900 0 0 Starting Values
I want to extract the numeric values from each line, but as can be
seen there are different numbers of values and one line has non-numeric
data that I wish to ignore. Currently I use strtok to (laboriously)
work through each data line, but I assume there must be better ways to
extract such data (and store it into an array or STL container) than
that.
Any thoughts? TIA