以下是引用broodwu在2005-3-16 15:26:43的发言:
还是不行啊,chenhui530的批处理我试了一下,只能把第一组数据的保留下来。当有多组数据就只能取到第一组数据,而且格式稍微变化一下就没办法了。我想应该用查找特征字符的办法来完成这个功能。比如查找到 (Debye): 这8个字符,那么下面一行自然就是需要的东西了(只截取其中的x,y,z的值)。而且有多组数据时也能够输出多组数据。比如下面这个a.txt文件,
~~~~~~~~~~~~~~~~~
sfjhjhof Mulliken charges= 0.00000
Electronic spatial extent (au): <R**2>= 1554.1028
Dipole moment (Debye):
X= -6.0857 Y= 1.8518 Z= 1.1246 Tot= 598 GradGradGraGradGradGradGradGrad
Internal Forces: Max 0.045440870 RMS 0.014163473
Step number 1 out of a maximum of 75
All units (Hartrees-Bohrs-Radians)
$FgSum of Mulliken charges= 0.00000
Electronic spatial extent (au): <R**2>= 1554.1028
Charge= 0.0000 electrons
Dipole moment (Debye):
X= -6.0877 Y= 1.8251 Z= 1.12987 Tot= 6.45433598
Sum of Mulliken charges= 0.00000
Electronic spatial extent (au): <R**2>= 1554.1028
Charge= 0.0000 electrons
Dipole moment (Debye):
X= -7.0857 Y= 5.82818 Z= 1.3046 Tot= 6.4598
GradGradGr
Internal Forces: Max 0.045440870 RMS 0.014163473
Steper 1 out of a maximum of 75
All quantities printed in internal units (Hartrees-Bohrs-Radians)
~~~~~~~~~~~~~~~~~
就应该输出下面这样一组数据,
-6.0857 1.8518 1.1246
-6.0877 1.8251 1.12987
-7.0857 5.82818 1.3046
或者下面一组数据也可以
X= -6.0857 Y= 1.8518 Z= 1.1246 Tot= 6.4598
X= -6.0877 Y= 1.8251 Z= 1.12987 Tot= 6.45433598
X= -7.0857 Y= 5.82818 Z= 1.3046 Tot= 6.4598 |
|