Question: Can any one help to change a data.txt format, use Python for example, data.txt file like this: .I 1 .T experimental investigation of the aerodynamics
Can any one help to change a data.txt format, use Python
for example, data.txt file like this:
.I 1 .T experimental investigation of the aerodynamics of a wing in a slipstream . .A brenckman,m. .B j. ae. scs. 25, 1958, 324. .W experimental investigation of the aerodynamics of a wing in a slipstream .
.I 2 .T simple shear flow past a flat plate in an incompressible fluid of small viscosity
.I 3 .T the boundary layer in simple shear flow past a flat plate . .A m. b. glauert .B ----------------------------------------
all lines after .I 1 and before .I 2 will be assign 1, all lines after .I 2 before .I 3 will be assign 2, will be :
1 .T 1 experimental investigation of the aerodynamics of a 1 wing in a slipstream . 1 .A 1 brenckman,m. 1 .B 1 j. ae. scs. 25, 1958, 324. 1 .W 1 experimental investigation of the aerodynamics of a 1 wing in a slipstream .
2 simple shear flow past a flat plate in an incompressible fluid of small 2 viscosity 3 .T 3 the boundary layer in simple shear flow past a flat plate . 3 .A 3 m. b. glauert 3 .B
_____________
Use the regular expressions to find the contents between patterns like '.I [0-9]+ .W ' and then go through it and assign ID to each one, OR use pandas dataframe as well to work with it as csv.
Please post step by step here. Thank you!
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
