There are two problems
while True:
x=f.readlines()
You read the entire file on every loop, so you willl always get the first rec of the newly read list.
if not x: break
x.next()
This may exit if you have any blank lines in the file.
Instead, you want to loop through all of the records with a for() loop
input_list=open("cmd.batch.txt").readlines()
for rec in input_list:
print rec
if len( rec.strip() ) < 1:
print " that rec was an empty line"
woooee
Nearly a Posting Maven
2,454 posts since Dec 2006
Reputation Points: 777
Solved Threads: 714
If you want something to keep looping couldn't you just wrap it up in a while loop?
While count < somenumber:
do these things
willygstyle
Junior Poster in Training
60 posts since Aug 2009
Reputation Points: 17
Solved Threads: 9