text = " Deg. of freedom 1
Full point group T NOp 12
Largest Abelian subgroup D2 NOp 4
Largest concise Abelian subgroup D2 NOp 4
Standard orientation:
---------------------------------------------------------------------\
Center Atomic Atomic Coordinates (Angstroms)
Number Number Type X Y Z
---------------------------------------------------------------------\
1 6 0 0.000000 0.000000 0.\
000000
2 1 0 0.617765 0.617765 0.\
617765
3 1 0 -0.617765 \
-0.617765 0.617765
4 1 0 -0.617765 0.617765 \
-0.617765
5 1 0 0.617765 -0.617765 \
-0.617765
---------------------------------------------------------------------\
Rotational constants (GHZ): \
164.2463791 164.2463791 164.2463791
Standard basis: 6-31G(d) (6D, 7F)
There are 8 symmetry adapted cartesian basis functions of \
A symmetry.
There are 5 symmetry adapted cartesian basis functions of B1 \
symmetry.
Old FWG=T [O(C1),4C3(H1)]
New FWG=TD [O(C1),4C3(H1)]
Largest Abelian subgroup D2 NOp 4
Largest concise Abelian subgroup D2 NOp 4
Standard orientation:
---------------------------------------------------------------------\
Center Atomic Atomic Coordinates (Angstroms)
Number Number Type X Y Z
---------------------------------------------------------------------\
1 6 0 0.000000 0.000000 0.\
000000
2 1 0 0.631339 0.631339 0.\
631339
3 1 0 -0.631339 \
-0.631339 0.631339
4 1 0 -0.631339 0.631339 \
-0.631339
5 1 0 0.631339 -0.631339 \
-0.631339
---------------------------------------------------------------------\
Rotational constants (GHZ): \
157.2594345 157.2594345 157.2594345";
Here's a text,It is actually generated by the Gaussian09 calculation program. I have captured a small part here, and my goal is to extract the coordinates inside, as shown in the figure below
My idea is to take most of this out and look at it with "Standard orientation:" and "--"
str1 = "Standard orientation:";
str2 = "---------------------------------------------------------------------";
I tried to use the StringCases
function to do it but I've done it many times and failed, and now I don't know how to do it, I don't know what match to do to match what I want, I can't think of so far
StringCases
function to do it but I've done it many times and failed. "StringCases
is the correct function to use. How did you try? Please show us your trial so we can tell you what's wrong. $\endgroup$Shortest
. $\endgroup$Import
can handle direct importing from Gaussian log files reference.wolfram.com/language/ref/format/GaussianLog.html ; the results go into aMolecule
and you can extract the coordinates appropriately (if your goal is to extract coordinates rather than do text file processing) $\endgroup$Import
really "doesn't do much"? $\endgroup$