Question
Can anyone help for regular expression in python: Use the regular expressions to find the contents between patterns like '.I [0-9]+ .W ' and then
Can anyone help for regular expression in python:
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.
----------------------------------------------
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
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started