← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #270082]: Calling a data from TXT file

 

Question #270082 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/270082

    Status: Open => Answered

RaiMan proposed the following answer:
i = 0
lines = open("notepad file.txt").readlines()
for line in lines:
    i += 1
    type("PLAN"+str(i))
    fields = line.split()
    name = fields[1]
    age = fields[3]
    sex = fields[5]
    type(name)
    type(age)
    type(sex)

Since you want to do something for each line in your file, the outer
loop must step through ones of the file.

-- 
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.