Text filtering/replacement
Posted: Thu Mar 05, 2020 2:59 pm
Hello.
I am looking for efficient way to edit data files which contain data line I do not need. Here is an example:
0.000 -0.005 -0.005 -0.005 1.245 9.588 -2.027
0.001 -0.005 -0.005 -0.005 1.245 9.588 -2.027
0.002 -0.005 -0.005 -0.005 1.245 9.588 -2.027
0.003 0.000 -0.005 -0.005 1.245 4.632 -1.626
START
0.004 0.000 -0.005 -0.005 1.245 4.632 -1.626
0.005 0.000 0.000 -0.005 1.245 0.079 -1.258
0.006 0.000 0.000 -0.005 1.250 0.079 -1.258
0.007 -0.005 -0.005 -0.005 1.245 9.588 -2.027
0.008 0.000 0.000 -0.005 1.250 0.079 -1.258
STOP
0.009 0.000 0.000 -0.005 1.245 0.079 -1.258
0.010 0.000 -0.005 -0.005 1.245 4.632 -1.626
START
0.011 0.000 0.000 -0.005 1.245 0.079 -1.258
0.012 0.000 -0.005 -0.005 1.245 4.632 -1.626
0.013 0.000 0.000 -0.005 1.240 0.079 -1.258
0.014 0.000 0.000 -0.005 1.245 0.079 -1.258
0.015 0.000 0.000 -0.005 1.240 0.079 -1.258
0.016 -0.005 -0.005 -0.005 1.245 9.588 -2.027
0.017 0.000 0.000 -0.005 1.245 0.079 -1.258
0.018 0.000 0.000 -0.005 1.245 0.079 -1.258
0.019 0.000 0.000 -0.005 1.250 0.079 -1.258
0.020 0.000 0.000 -0.005 1.245 0.079 -1.258
STOP
I need somehow to delete lines containing STOP and START words and keep columns so there is no gap in data. Was trying to split data and join it. But that way need some kind of loop and store string temporary...
How else to remove just those strings which containing START STOP?
Thank you
I am looking for efficient way to edit data files which contain data line I do not need. Here is an example:
0.000 -0.005 -0.005 -0.005 1.245 9.588 -2.027
0.001 -0.005 -0.005 -0.005 1.245 9.588 -2.027
0.002 -0.005 -0.005 -0.005 1.245 9.588 -2.027
0.003 0.000 -0.005 -0.005 1.245 4.632 -1.626
START
0.004 0.000 -0.005 -0.005 1.245 4.632 -1.626
0.005 0.000 0.000 -0.005 1.245 0.079 -1.258
0.006 0.000 0.000 -0.005 1.250 0.079 -1.258
0.007 -0.005 -0.005 -0.005 1.245 9.588 -2.027
0.008 0.000 0.000 -0.005 1.250 0.079 -1.258
STOP
0.009 0.000 0.000 -0.005 1.245 0.079 -1.258
0.010 0.000 -0.005 -0.005 1.245 4.632 -1.626
START
0.011 0.000 0.000 -0.005 1.245 0.079 -1.258
0.012 0.000 -0.005 -0.005 1.245 4.632 -1.626
0.013 0.000 0.000 -0.005 1.240 0.079 -1.258
0.014 0.000 0.000 -0.005 1.245 0.079 -1.258
0.015 0.000 0.000 -0.005 1.240 0.079 -1.258
0.016 -0.005 -0.005 -0.005 1.245 9.588 -2.027
0.017 0.000 0.000 -0.005 1.245 0.079 -1.258
0.018 0.000 0.000 -0.005 1.245 0.079 -1.258
0.019 0.000 0.000 -0.005 1.250 0.079 -1.258
0.020 0.000 0.000 -0.005 1.245 0.079 -1.258
STOP
I need somehow to delete lines containing STOP and START words and keep columns so there is no gap in data. Was trying to split data and join it. But that way need some kind of loop and store string temporary...
How else to remove just those strings which containing START STOP?
Thank you