Hi,
I'm trying to run a batch of commands from a .txt file using python. ("cmd.batch.txt" = ~1000 command lines :
perl cmd.1.pl -in -parameters)
and redirect renamed output files to new folders. It works fine for the first line, but I'm having trouble getting something to loop through all of the commands in "cmd.batch.txt".
Any help would be much appreciated !
-M
import os
f=open("cmd.batch.txt")
while True:
x=f.readlines()
y=x[0][10:30]
w=y.split(" ")
os.system(x[0])
for fn in os.listdir("."):
if fn[-5:] == "ML.dS":
os.rename(fn, "./dS/"+ w[1] +"ML.dS")
if fn[-5:] == "NG.dS":
os.rename(fn, "./dS/"+ w[1] + "NG.dS")
if not x: break
x.next()