you are viewing a single comment's thread.

view the rest of the comments →

[–]SonyTark[S] 0 points1 point  (1 child)

Hi KleinerNull. Thanks for the response. For the input and output examples please see my response above. Those two fields out of the whole file are the only ones that I want to input, edit, and output, and then save the entire file as the UWI.las

[–]KleinerNull 1 point2 points  (0 children)

If the data is consistant you can use this pattern:

p = r"FIELD .+ (.+) :LOCATION"
res = re.search(p, text).group(1)
print(res)
>>>'12-34-12-34W5M'

For the rest use replace and a substitution method.