Parsing specific numeric data from csv file using python

Posted by KJ Lim on Stack Overflow See other posts from Stack Overflow or by KJ Lim
Published on 2010-05-14T09:08:57Z Indexed on 2010/05/14 9:14 UTC
Read the original article Hit count: 335

Filed under:
|

Good morning.

I have series of data in cvs file like below,

1,,,

1,137.1,1198,1.6

2,159,300,0.4

3,176,253,0.3

4,197,231,0.3

5,198,525,0.7

6,199,326,0.4

7,215,183,0.2

8,217.1,178,0.2

9,244.2,416,0.5

10,245.1,316,0.4

I want to extract specific data from second column for example 217.1 and 245.1 and have them concatenated into a new file like,

8,217.1,178,0.2

10,245.1,316,0.4

I use cvs module to read my cvs file, but, I can't extract specific data as I desire. Could anyone kindly please help me. Thank you.

© Stack Overflow or respective owner

Related posts about python

Related posts about csv