Using Python read specific (column, row) values from a txt file

Posted by user2955708 on Stack Overflow See other posts from Stack Overflow or by user2955708
Published on 2013-11-05T09:50:38Z Indexed on 2013/11/05 9:52 UTC
Read the original article Hit count: 172

Filed under:
|

I would like to read values from a text file until that is a float value. Lets say I have the following file:

14:53:55

Load 300 Speed 200

Distance,m Fz Fx Speed 0.0000 249 4 6.22 0.0002 247 33 16.29 0.0004 246 49 21.02 0.2492 240 115 26.97 0.2494 241 112 21.78 0.2496 240 109 13.09 0.2498 169 79 0.27

Distance,m Fz Fx Speed 0.0000 249 4 7.22 0.0002 247 33 1.29 0.0004 246 49 271.02 0.2492 240 115 26.97 0.2494 241 112 215.78 0.2496 240 109 13.09 0.2498 169 79 0.27

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

© Stack Overflow or respective owner

Related posts about python

Related posts about file