|
本帖最后由 hxd_yi 于 2016-1-8 16:04 编辑
这个脚本可以帮你,使用方法:脚本保存为gt.sh,然后执行./gt.sh *.out,就可以把out文件中结果提取出来了,也可以换成其他文件。
#!/bin/bash
echo -e "filename\tnumber of imaginary frequencies\tmin freq\tElectronic energy\t\
Zero-point correction\t\
Thermal correction to Energy\t\
Thermal correction to Enthalpy\t\
Thermal correction to Gibbs Free Energy"
for inf in $@; do
if ! [ -f $inf ] ; then
continue
fi
if [ -z "$(head -n 1 $inf | grep 'Entering Gaussian System,')" ]; then
continue
fi
echo -ne $inf'\t'
tf=`tail -n 1 $inf| grep 'Normal termination of Gaussian 09'`
if [ -z "$tf" ]; then
echo 'Error'
continue
fi
nf=`grep 'imaginary frequencies (negative Signs)' $inf | awk '{print $2}'`
if [ -z $nf ]; then
nf=0
fi
echo -ne $nf'\t'
grep 'Frequencies --' $inf | head -n 1 | awk '{printf("%s\t",$3);}'
grep "SCF Done" $inf | tail -n 1 | awk '{printf("%s\t",$5);}'
# a=`grep -n 'Zero-point correction' $inf | cut -d ':' -f 1`
# b=`expr $a + 7`
# sed -n -e "$a,$b"p $inf
grep 'Zero-point correction' $inf | awk '{printf("%s\t",$3);}'
grep 'Thermal correction to Energy' $inf | awk '{printf("%s\t",$NF);}'
grep 'Thermal correction to Enthalpy' $inf | awk '{printf("%s\t",$NF);}'
grep 'Thermal correction to Gibbs Free Energy' $inf | awk '{printf("%s",$NF);}'
echo -e ""
###############################################################
# str=`grep -e "Alpha occ. eigenvalues" $inf | tail -n 1`
# if [ ! -z "$str" ]; then
# echo "$str" | awk '{print " HOMO of Alpha:\t" $NF}'
# fi
#
# str=`grep -e "Alpha virt. eigenvalues" $inf | head -n 1`
# if [ ! -z "$str" ]; then
# echo "$str" | awk '{print " LUMO of Alpha:\t" $5}'
# fi
#
# str=`grep -e "Beta occ. eigenvalues" $inf | tail -n 1`
# if [ ! -z "$str" ]; then
# echo "$str" | awk '{print " HOMO of Beta:\t" $NF}'
# fi
#
# str=`grep -e "Beta virt. eigenvalues" $inf | head -n 1`
# if [ ! -z "$str" ]; then
# echo "$str" | awk '{print " LUMO of Beta:\t" $5}'
# fi
##############################################################
done
|
评分 Rate
-
查看全部评分 View all ratings
|