data file handling

Dear all,
I have a problem with data handling of a text file consists of numbers and characters. Here is the part of my data file:

timestep 1e-5 coordinates
21 5400 432.67 1278E7 668.89
25 5600 563.89 1280E7 660.90
31 6680 670.30 1489E8 -770.65
56 -4430 780.88 -67.5E3 -800.09
timestep 1e-5 forces {I should skip this section and do not store them}
21 4589 6790 7800
25 4780 5589 -80
31 3278 9900 6589
56 9032 5578 1E-3
------------------------------
timestep 5e-5 coordinates
21 7800 682.60 1478E8 690.60
25 9600 963.09 -780.9E7 810.70
31 -9867 1670.30 1489E9 -770.65
56 6430 7010.65 -177.5E8 -800.09
timestep 5e-5 forces {I should skip this section and do not store them}
21 3167 8090 8800
25 4780 5239 3180
31 8750 9900 9670
56 8902 5578 0.0
------------------------------
timestep 1e-3 coordinates
21 9832 -92.67 8208E7 1668.89
25 -600 1960.89 1280E7 -1660.90
31 6680 4580.30 1789E8 -7701.65
56 -4430 7880.88 967.5E3 -8780.09
timestep 1e-3 forces {I should skip this section and do not store them}
21 4089 7000 7800
25 7880 8909 -80
31 -675 6660 6589
56 -734 1078 1E-3
------------------------------
timestep 1e-2 coordinates
21 5600 -1432.67 1278E7 668.89
25 5600 563.89 1280E7 660.90
31 6680 550.00 889E8 -800.65
56 -3730 4598.00 -1773.8 -128.09
timestep 1e-5 forces {I should skip this section and do not store them}
21 880 8976 -987
25 7080 9089 580
31 -978 6080 6589
56 0.09 7500 1E-3
------------------------------
.....
.....

This kind of data repeated with different value up to 1000 times. Now I want to store just the first block information which associated with the first entry in each line of data and skip the data belong to the second block for each line.
For example, I want to store coordinates data:
5400 432.67 1278E7 668.89 for 21
6680 670.30 1489E8 -770.65 for 31
and skip the force data for 21 and 31
then again store data for 21 and 31 in next block, ie:
7800 682.60 1478E8 690.60 for 21
-9867 1670.30 1489E9 -770.65 for 31
and do this in each cycle up to the last entry set.
I appreciate if you help me.
Kindly regards
Topic archived. No new replies allowed.