Script for replacing digits
<p>I have a file that has content as below</p>

<pre><code>a      b     c    123.67989

aa   bb  cc   56789.38475

b    c   a    56789.3456

bb   cc  aa   0.12409124

c    a   b    0.0123123
</code></pre>

<p>I am trying to remove digits after the <code>.</code> in the each line. Is there is a way to do this using regular expressions in Python?
Code I wrote
f1 = open('filename.txt','r')</p>

<p>for line in f1:</p>

<pre><code>    words = line.split()
    print(words[3])
</code></pre>

<p>I am trying retrieve last row information and I keep getting error list indices out of range</p>

<p>Get only digits with one decimal value:</p>

<pre><code>import re

text = """
a      b     c    123.67989

aa   bb  cc   56789.38475

b    c   a    56789.3456

bb   cc  aa   0.12409124

c    a   b    0.0123123
"""

digits = re.findall(r'\d+\.\d{1}', text)
print(digits)

# prints: ['123.6', '56789.3', '56789.3', '0.1', '0.0']
</code></pre>

python python-3.x