I use G09 to calculate electron proprieties of molecules to use in my master degree. I have a lot of output files and would be good if i put all data that i need into a single file.
My idea is to use sed command to select the data and than copy to another file. However it is not working well. I will explain why with 3 examples:
- This is a part of an output file, i am interested in the value
-382.8066162 (HF=-382.8066162):
\\Version=ES64L-G09RevD.01\State=1-A'\HF=-382.8066162\RMSD
=4.013e-09\Dipole=0.5408183,-0.047947,0.\Quadrupole=1.1759993,3.185993
9,-4.3619932,-4.1913364,0.,0.\PG=CS [SG(C6H6O2)]\\
So, to do that i use the following command in terminal:
sed '/HF=.*RMSD/ {s/.*HF=//; s/RMSD.*//; b; }; d' < cs.log |tr -d '\' >> teste
And it works very well! But look at others examples of output file.
- This is a part of other output file, again i am interested in the value
-382.791406:
\\Version=ES64L-G09RevD.01\State=2-A'\HF=-382.79140
6\S2=0.750062\S2-1=0.\S2A=0.75\RMSD=6.390e-09\Dipole=-1.5048474,-0.989
1441,0.\Quadrupole=-14.9615773,1.2107467,13.7508306,9.5370629,0.,0.\PG
=CS [SG(C6H6O2)]\\@
The data skipped a line - the value 6 is in the beginning of the next line - and the word after the value also changed (to S2).
- This is a part of other output file, again i am interested in the value
HF=-382.3893192:
\\Version=ES64L-G09RevD.01\State=2-A'\HF=-382
.3893192\S2=0.750091\S2-1=0.\S2A=0.75\RMSD=4.227e-09\Dipole=-1.8688747
,-0.9712963,0.\Quadrupole=-15.2914168,1.4139864,13.8774304,10.0476251,
0.,0.\PG=CS [SG(C6H6O2)]\\@
Again, the data HF=-382.3893192 was separeted into two lines. The first part HF=-382 and the second part .3893192.
How can i fix it?
Thanks