So I have a number of text files with a line like this:
STRT .M -9.0: START DEPTH
I wish to detect the negative number and replace it with 0.1.
I can detect the negative number, simply by looking for the '-'
text.count('-')
if text.count('-') > 0, there is a negative number.
My question is: How do I replace '-9.0' in the string that with the number 0.1? Ultimately, I want to output:
STRT .M 0.1: START DEPTH