Sunday, September 4, 2016

Extracting Frequency data from a Gaussian 09 calculation

This small awk script was inspired by the Python solution I found on this excellent blog [ Lindqvist - a blog about Linux and Science. Mostly. ] You can find my solution in the comments section of the blog.

So, I would like to extract/collect the results from a Gaussian09 harmonic frequency calculation.
Since collecting the rest of the data from the Gaussian output is pretty much identical I have done it anyway.

#!/bin/awk -f

/Frequencies/ { for (i=3;i<=NF; i++) { im++; freq[im ]=$i } }
/Frc consts/  { for (i=NF;i>=4; i--)     fc[im-(NF-i)]=$i   }
/IR Inten/    { for (i=NF;i>=4; i--)     ir[im-(NF-i)]=$i   }

END { for (i=1;i<=im;i++) print freq[i],fc[i],ir[i] }

This will print the collected values in three columns, identical to the Python script.

No comments:

Post a Comment