To get the output geometry of a *.out file (Q-Chem)
Using rev, column commands
grep " B " lda_bnr_2_n_ring_03_geo_restricted_singlet.out | tail -n6 | awk 'BEGIN {OFS=" ";} {print $1, $3, $5}' | rev | column -t | rev
Using AWK
grep " B " lda_bnr_2_n_ring_03_geo_restricted_singlet.out | tail -n6 | awk 'BEGIN {OFS="
";} {print $1, $3, $5}'
To extract the geometry from a *.out file ($f) and paste in a ea/ip file (and insert $molecule at the beginning)
ClusterHOme$ ./script_ea_input.sh#!/usr/bin/env bashfor f in *.out; dofor g in ea*.in; don=$(((ls $f) | cut -d_ -f6))t=$((2 * $n ))grep " B " $f | tail -${t} | awk 'BEGIN {OFS=" ";} {print $1, $4, $5, $6}' | rev | column -t | rev > xyz.xyzsed -i '1i -1 2' xyz.xyzsed -i '1i $molecule' xyz.xyzecho '$end' >> xyz.xyzcat xyz.xyz ./input_ea.in > $gdonedone
./script_ea_input.sh: line 4: (ls lda_bnr_2_n_ring_05_geo_restricted_singlet.out) | cut -d_ -f6: syntax error: invalid arithmetic operator (error token is ".out) | cut -d_ -f6")
========================================
Using two for loops:
for i in *.out; do
for j in *.in; do
what/you/want/to/do
done
done
No comments:
Post a Comment