So, I have some text files with a line like this:
STRT .M -9.0: START DEPTH
I want to determine a negative number and replace it with 0.1.
I can detect a negative number just by looking at the '-'
text.count('-')
if text.count ('-')> 0, there is a negative number.
My question is: how to replace '-9.0' in line number 0.1? Ultimately, I want to deduce:
STRT .M 0.1: START DEPTH
source
share