xyz2dalmol

Convert xyz file to DALTON mol file format.

Example

Just run xyz2dalmol.py BASIS XYZFILE [CHARGE] on an xyz file. If the contents of the file pNP.xyz is:

14
Coordinates for the paranitrophenolate anion
  C    0.00024517377001     -0.00000127535767      2.21622044798363
  C    0.00001911722346      1.21868995413483      1.43323689248097
  C   -0.00008516064952      1.21363684075454      0.06907678362126
  C   -0.00003707964110      0.00000392709139     -0.64164935268151
  C   -0.00006702107041     -1.21362967937843      0.06907464419941
  C    0.00003129317864     -1.21868903220742      1.43323324558520
  O    0.00019750365472     -0.00000468668058      3.46326648564854
  N    0.00017340459148     -0.00000408767064     -2.04649565547677
  O    0.00012174016831     -1.07993818270615     -2.64921243830043
  O    0.00012626265799      1.07993000318773     -2.64924166551258
  H   -0.00012369331440      2.15334790254679      1.98383412273004
  H   -0.00023215149939      2.13643459910223     -0.49733347811826
  H   -0.00022703591052     -2.13642616894168     -0.49733747889222
  H   -0.00014235315927     -2.15335011387495      1.98382609845391

Running the command ./xyz2dalmol.py cc-pVTZ pNP.xyz -1 will output the file pNP.mol, containing:

BASIS
cc-pVTZ
14 
Coordinates for the paranitrophenolate anion
Atomtypes=5 Angstrom Charge=-1 NoSymmetry
Charge=6 Atoms=6
  C    0.00024517377001     -0.00000127535767      2.21622044798363
  C    0.00001911722346      1.21868995413483      1.43323689248097
  C   -0.00008516064952      1.21363684075454      0.06907678362126
  C   -0.00003707964110      0.00000392709139     -0.64164935268151
  C   -0.00006702107041     -1.21362967937843      0.06907464419941
  C    0.00003129317864     -1.21868903220742      1.43323324558520
Charge=8 Atoms=1
  O    0.00019750365472     -0.00000468668058      3.46326648564854
Charge=7 Atoms=1
  N    0.00017340459148     -0.00000408767064     -2.04649565547677
Charge=8 Atoms=2
  O    0.00012174016831     -1.07993818270615     -2.64921243830043
  O    0.00012626265799      1.07993000318773     -2.64924166551258
Charge=1 Atoms=4
  H   -0.00012369331440      2.15334790254679      1.98383412273004
  H   -0.00023215149939      2.13643459910223     -0.49733347811826
  H   -0.00022703591052     -2.13642616894168     -0.49733747889222
  H   -0.00014235315927     -2.15335011387495      1.98382609845391