I would like to read values from a text file until that is a float value. Lets say I have the following file:
Time
Detailes
Distance Fz Fx.
0.0000 249 4
0.0002 247 33
0.0004 246 49
0.0006 243 61
Distance Fz Fx.
0.0000 249 4
0.0002 247 43
0.0004 246 59
0.0006 243 70
And I need only the values under the first Distance column.
So something like skip the first few rows, then read values from the first column while it is float.
Thanks your help in advance
Make a state machine that will
readline()
/for line in file
and do things and/or switch state depending onre.match()
result on regexes corresponding to different lines' formats.This is the standard approach to parse input that isn't so complex as to require a lexical analyzer.