Skip to content

Instantly share code, notes, and snippets.

@SeanMcGrath
Created April 6, 2015 20:05
Show Gist options
  • Save SeanMcGrath/3a6c2106476d4754be17 to your computer and use it in GitHub Desktop.
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.
#!/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