Hi have this text file that groups information in between the characters "*******************************" eg:
*******************************
15674B 2000
#12 DIVERSION
800.000
COORDINATES
0
FLOW DIRECTION
0
PROTECT DATA
0
DATUM
0.00
RADIUS TYPE
2
DIVIDE X-Section
0
SECTION ID
INTERPOLATED
0
ANGLE
0.00 0
RESISTANCE NUMBERS
0 0 1.000 1.000 1.000 1.000 1.000
PROFILE 8
-15.000 12.000 1.000 <#0> 0 0.000 0
0.000 10.960 1.000 <#1> 0 0.000 0
0.600 10.820 1.000 <#0> 0 0.000 0
0.700 10.410 1.000 <#0> 0 0.000 0
1.540 9.990 1.000 <#0> 0 0.000 0
4.040 9.980 1.000 <#2> 0 0.000 0
6.200 11.160 1.000 <#4> 0 0.000 0
15.000 12.000 1.000 <#0> 0 0.000 0
LEVEL PARAMS
0 0 0.000 0 0.000 20
*******************************
15674B 2000
#12 DIVERSION
900.000
What I am trying to do is extract the second and third line (#12 DIVERSION, 800.00) underneath the characters "*******************************" as well as the PROFILE information on lines 24 -32, and save them to a csv file.
I know that I can use python to read the file eg:
with open ("results.txt","r") as myResults:
readFile = myResults.readlines()
but my issues is I don't know how identify groups of information between characters "*******************************" and then extract certain lines out.
Any assistance would be greatly appreciated.
myResults.read().split('*******************************')to get chunks contained between star lines.