我有一个名为myfile.txt的文件,如下所示:
&cntrl
pTopt = 298.15, pdens = 0.997, prcut = 12.0, pion = t,
pihot = t, prQM = 5.5, prSM = 5.3, prQI=3.0, piguess = f,
pinit = t, pnstep = 5000, pnscale = 100,
pnstat = 5, pnout = 5, pnrst = 5, pioutc = t, pioutv = t, pnoutc=5,
pnoutv = 5,
msolute = t, nosa = 1, pichrg = t
gfileOut = 'as-1.out',
gfileEnout = 'as-1.en',
gfileInfo = 'as-1.info',
gfileStart = 'init.in',
gfileRst = 'as-1.rst',
gfileTraj = 'as-1.traj',
gfileVeloc = 'as-1.vel',
gfileQmen = 'as-1.qmen'
&end
使用上面给出的单个文件我想要创建10个文件,但我想以每个新文件中变量值随文件更改次数的变化的方式操作最后8个变量的值,即10个文件是然后创建最后八个变量的值,如tength文件中的gfileOut应该是' as-10.out'。