A script that convert Gaussian 16 log file to molden format xyz file
To use, just type lxyz logname.log or logxyz logname.log after it had been installed or manually source the script source log-xyz.sh logname.log
The description of how it works is also in the comments in the script
This writes to .bashrc so do check it.(Only works on Redhat)
To install source install.sh Then type y
- To install manually, type
then
cp log-xyz.sh log-xyzchmod +x log-xyz cd /homeopen .bashrcvi .bashrcthen under "# User specific aliases and functions", type inmake sure to select the chmodded file. This alias can be customized such asalias lxyz='/path/to/log-xyz'alias logxyz='/path/to/log-xyz'
GINC, Version, \ case sensitive and including Version with spaces in between eg. Ver sion
These word cannot be in the title of the .inp file since it will appear on .log file
If the tab spaces are unsightly change it to space (The file is still completely usable just ugly)
In vim :
:%s/\s\+/ /g
using sed:
sed -e 's/[[:space:]]/\ /g' filename.xyz
This replaces all tab space with space
cat the log | sed to get only the line between 1\1\GINC and Version | tr to join all line together | turn every \ to a new line |
remove line 1-16 (THIS WILL BREAK IF TITLE CONTAIN "\" ) | head to get only the natoms amount of line | awk to turn it to nice column |
sed to write SCF energy | sed to write number of atoms to file
If something breaks here good luck
If you want to change how the thing comes out just modify the last > ${logname}.xyz to whatever you want
If you need just the pure xyz coordinates the last 2 sed can be removed but this will no longer be molden format (useful when piping to .com or .inp files)
old-log-xyz.sh is an old script that only breaks if the word Version got cut off to a new line, use this one if the new code breaks for some reason