Created
April 6, 2015 20:05
-
-
Save SeanMcGrath/3a6c2106476d4754be17 to your computer and use it in GitHub Desktop.
Creates a .csv file of computed Raman intensities and frequencies from a Gaussian output file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# generates comma-separated list of raman frequencies and intensities from | |
# Gaussian output file. | |
if [[ $# > 0 ]] | |
then | |
egrep '(Frequencies|^ Raman )' $1 | awk ' | |
{ | |
if ( $1 == "Frequencies"){ | |
a = $3 | |
b = $4 | |
c = $5 | |
} | |
else { | |
freqs[a] = $4 | |
freqs[b] = $5 | |
freqs[c] = $6 | |
} | |
} | |
END { | |
print "Frequency,Intensity" | |
for (freq in freqs) { | |
print freq "," freqs[freq] | |
} | |
} | |
' | sort -g | |
else | |
echo 'Enter a file to parse' | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment