Jul-07-2020, 12:44 PM
I'm quality controlling output within a Python file method. What I want to do is if I have two consecutive sentences in the code that both end with periods (.), first sentence starts with "First" and next sentence starts with "Second", make any number values in the "Second" sentence no higher than the highest number value found in the "First" sentence. I've tried using re.sub and sed but cannot get this working. Here's an example:
Input:
First sentence lists numbers 3 and 4. Second sentence shows a value of 5 and also a 6.
Output:
First sentence lists numbers 3 and 4. Second sentence shows a value of 4 and also a 4.
Input:
First sentence lists numbers 3 and 4. Second sentence shows a value of 5 and also a 6.
Output:
First sentence lists numbers 3 and 4. Second sentence shows a value of 4 and also a 4.