I wanted to create a script what would take two numbers out of two files and add them together, but I got stuck with greping numbers what have a dot in it.
So far I have grepped the two lines what include the numbers I need (from both files) to a third file and from that file I try to grep only the numbers.
The third file looks like this:
aoforce.out: * zero point VIBRATIONAL energy : 0.6725445 Hartree *
job.last: | total energy = -3842.57456191055 |
The script I have at the moment (thanks to your forums :o ) is like this:
grep -ho '[-0-9]\{1,20}'
and with that script I get an output like this:
0
6725445
-3842
57456191055
But I would like an output like this:
0.6725445
-3842.57456191055
```[/i]
Thank you in advance,
Mario
Yes they are, but sometimes file "job.last" number varies. In my example it had four numbers before the dot but sometimes it has three or even two. Behind the dot there are always eleven numbers (and seven in aoforce.out).