I have a large text file, as you can see in the following, including strings and numbers. I want to read just numbers and also delete rows which have just 3 columns and write them into a matrix(m by n). could someone tell me what is the best way in python to manipulate such files?
My file is something like:
# Chunk-averaged data for fix Dens and group ave
# Timestep Number-of-chunks Total-count
# Chunk Coord1 Ncount density/number
4010000 14 1500
1 4.323 138.758 0.00167105
2 12.969 121.755 0.00146629
3 21.615 127.7 0.00153788
4 30.261 131.682 0.00158584
5 38.907 127.525 0.00153578
6 47.553 136.322 0.00164172
7 56.199 118.014 0.00142124
8 64.845 125.842 0.00151551
9 73.491 120.684 0.00145339
10 82.137 132.282 0.00159306
11 90.783 121.567 0.00146402
12 99.429 97.869 0.00117863
13 108.075 0 0
14 116.721 0 0......
numpy:)