Re: [Sikuli-driver] [Question #270082]: Calling a data from TXT file
Question #270082 on Sikuli changed: https://answers.launchpad.net/sikuli/+question/270082 Status: Answered => Solved Anurag confirmed that the question is solved: Thanks Raiman!! yes its solves my problem Thank you so muchhh.you rocked -- You received this question notification because your team Sikuli Drivers is an answer contact for Sikuli. ___ Mailing list: https://launchpad.net/~sikuli-driver Post to : sikuli-driver@lists.launchpad.net Unsubscribe : https://launchpad.net/~sikuli-driver More help : https://help.launchpad.net/ListHelp
Re: [Sikuli-driver] [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: ok, my fault: i = 0 lines = open("notepad file.txt").readlines() for line in lines: i += 1 type("PLAN"+str(i)) fields = line.split() k = 2 n = 1 name = "" while fields[n] != "age": name += " " + fields[n] k += 1 n += 1 age = fields[k] sex = fields[k + 2] in my test with your above data I got this: PLAN1 Anurag Gupta 12 male PLAN2 Lokesh Sharma 24 male PLAN3 Ashu Gupta 23 male -- You received this question notification because you are a member of Sikuli Drivers, which is an answer contact for Sikuli. ___ Mailing list: https://launchpad.net/~sikuli-driver Post to : sikuli-driver@lists.launchpad.net Unsubscribe : https://launchpad.net/~sikuli-driver More help : https://help.launchpad.net/ListHelp
Re: [Sikuli-driver] [Question #270082]: Calling a data from TXT file
Question #270082 on Sikuli changed: https://answers.launchpad.net/sikuli/+question/270082 Status: Answered => Open Anurag is still having a problem: Raiman, It shows me a error suggested below 'name += " " + fields[n] IndexError: index out of range: 7' while executing the above code to print (name),print(age) -- You received this question notification because you are a member of Sikuli Drivers, which is an answer contact for Sikuli. ___ Mailing list: https://launchpad.net/~sikuli-driver Post to : sikuli-driver@lists.launchpad.net Unsubscribe : https://launchpad.net/~sikuli-driver More help : https://help.launchpad.net/ListHelp
Re: [Sikuli-driver] [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: = 0 lines = open("notepad file.txt").readlines() for line in lines: i += 1 type("PLAN"+str(i)) fields = line.split() k = 3 n = 2 name = "" while fields[n] != "age": k += 1 n += 1 name += " " + fields[n] age = fields[k] sex = fields[k + 2] -- You received this question notification because you are a member of Sikuli Drivers, which is an answer contact for Sikuli. ___ Mailing list: https://launchpad.net/~sikuli-driver Post to : sikuli-driver@lists.launchpad.net Unsubscribe : https://launchpad.net/~sikuli-driver More help : https://help.launchpad.net/ListHelp
Re: [Sikuli-driver] [Question #270082]: Calling a data from TXT file
Question #270082 on Sikuli changed: https://answers.launchpad.net/sikuli/+question/270082 Status: Solved => Open Anurag is still having a problem: Raiman A general query from my side the above script provide output by counting fields in notepad correct.. and say my txt looks like name Anurag Gupta age 12 sex male. name Lokesh Sharma age 24 sex male. name Ashu Gupta age 23 sex male. Above script provide output as Anurag 12 male and soon now i required name as Anurag Gupta 12 male and so on Please help me in this queery! -- You received this question notification because you are a member of Sikuli Drivers, which is an answer contact for Sikuli. ___ Mailing list: https://launchpad.net/~sikuli-driver Post to : sikuli-driver@lists.launchpad.net Unsubscribe : https://launchpad.net/~sikuli-driver More help : https://help.launchpad.net/ListHelp
Re: [Sikuli-driver] [Question #270082]: Calling a data from TXT file
Question #270082 on Sikuli changed: https://answers.launchpad.net/sikuli/+question/270082 Status: Answered => Solved Anurag confirmed that the question is solved: thanks Rai man, Yes my problem is solved.. thanks for your efforts -- You received this question notification because you are a member of Sikuli Drivers, which is an answer contact for Sikuli. ___ Mailing list: https://launchpad.net/~sikuli-driver Post to : sikuli-driver@lists.launchpad.net Unsubscribe : https://launchpad.net/~sikuli-driver More help : https://help.launchpad.net/ListHelp
Re: [Sikuli-driver] [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. ___ Mailing list: https://launchpad.net/~sikuli-driver Post to : sikuli-driver@lists.launchpad.net Unsubscribe : https://launchpad.net/~sikuli-driver More help : https://help.launchpad.net/ListHelp
Re: [Sikuli-driver] [Question #270082]: Calling a data from TXT file
Question #270082 on Sikuli changed: https://answers.launchpad.net/sikuli/+question/270082 Status: Needs information => Open Anurag gave more information on the question: ay my file look like this. name Anurag age 12 sex male. name Lokesh age 24 sex male. name Ashu age 23 sex male. and my code looks like for i in range(1,4): type("PLAN"+str(i)) #afterwards i used ur codes to fetch data from file lines = open("notepad file.txt").readlines() for line in lines: fields = line.split() name = fields[1] age = fields[3] sex = fields[5] type(name) type(age) type(sex) break It works fyn when i=1, it reflects name as Anurag, sex as male and age as 12. however problem arises when i=2 and it reflect same result as Anurag, male and 12 but i required next line data(from txt file) which is lokesh, male and 24. and so on like for i=3 it should shows ashu, male 23. -- You received this question notification because you are a member of Sikuli Drivers, which is an answer contact for Sikuli. ___ Mailing list: https://launchpad.net/~sikuli-driver Post to : sikuli-driver@lists.launchpad.net Unsubscribe : https://launchpad.net/~sikuli-driver More help : https://help.launchpad.net/ListHelp
Re: [Sikuli-driver] [Question #270082]: Calling a data from TXT file
Question #270082 on Sikuli changed: https://answers.launchpad.net/sikuli/+question/270082 Status: Open => Needs information RaiMan requested more information: did you get further? not really sure, what your problem is. Try to tell with your own words, what you want to achieve (use some pseudo code without too much details), instead of posting detailed code, that might not reflect your intention. -- You received this question notification because you are a member of Sikuli Drivers, which is an answer contact for Sikuli. ___ Mailing list: https://launchpad.net/~sikuli-driver Post to : sikuli-driver@lists.launchpad.net Unsubscribe : https://launchpad.net/~sikuli-driver More help : https://help.launchpad.net/ListHelp
Re: [Sikuli-driver] [Question #270082]: Calling a data from TXT file
Question #270082 on Sikuli changed: https://answers.launchpad.net/sikuli/+question/270082 Anurag posted a new comment: Please help me in my query i reallly needs this one... waiting for your reply guys HELP ME HELP ME HELP ME HELP ME -- You received this question notification because you are a member of Sikuli Drivers, which is an answer contact for Sikuli. ___ Mailing list: https://launchpad.net/~sikuli-driver Post to : sikuli-driver@lists.launchpad.net Unsubscribe : https://launchpad.net/~sikuli-driver More help : https://help.launchpad.net/ListHelp
Re: [Sikuli-driver] [Question #270082]: Calling a data from TXT file
Question #270082 on Sikuli changed: https://answers.launchpad.net/sikuli/+question/270082 Status: Open => Solved Anurag confirmed that the question is solved: Thanks RaiMan, that solved my question. -- You received this question notification because you are a member of Sikuli Drivers, which is an answer contact for Sikuli. ___ Mailing list: https://launchpad.net/~sikuli-driver Post to : sikuli-driver@lists.launchpad.net Unsubscribe : https://launchpad.net/~sikuli-driver More help : https://help.launchpad.net/ListHelp
Re: [Sikuli-driver] [Question #270082]: Calling a data from TXT file
Question #270082 on Sikuli changed: https://answers.launchpad.net/sikuli/+question/270082 Status: Solved => Open Anurag is still having a problem: please ignore the last comment and helped me in my query... -- You received this question notification because you are a member of Sikuli Drivers, which is an answer contact for Sikuli. ___ Mailing list: https://launchpad.net/~sikuli-driver Post to : sikuli-driver@lists.launchpad.net Unsubscribe : https://launchpad.net/~sikuli-driver More help : https://help.launchpad.net/ListHelp
Re: [Sikuli-driver] [Question #270082]: Calling a data from TXT file
Question #270082 on Sikuli changed: https://answers.launchpad.net/sikuli/+question/270082 Anurag gave more information on the question: see my script, and please help me!! file = open("c:\\temp1\\t.txt", "r") ord = file.read() file.close() list = ord.splitlines() for x in list: plan = "AM15.019001-" #find("SprintCapaci.png") h = find("ToolBoxSearc.png") r = h.find("Search.png") click(r) wait(4) click(Pattern("CircuitID.png").targetOffset(-64,8)) wait(2) type(plan) type(x) type("\n") wait(10) type( u"\ue002") type(u"\ue002") wait(1) j=find("CircuitResul.png") hover(click(Pattern("Select.png").targetOffset(0,1))) wait(4) lines = open("c:\\temp1\\th.txt").readlines() for line in lines: fields = line.split() circuit = fields[1] ecckt = fields[3] comment = fields[5] #print circuit # print ecckt # print comment click(Pattern("ECCKT.png").targetOffset(-73,10)) wait(1) type(ecckt) find("AddNote_.png") doubleClick(Pattern("AddNote_.png").targetOffset(-411,19)) wait(1) type(comment) wait(2) type("\t") type( u"\ue004") wait(2) t=click(Pattern("CircuitDetai.png").targetOffset(-109,17)) click(t) wait(3) type("a", KEY_CTRL) type(u"\ue006") wait(1) type(circuit) click(Pattern("POPPopisNewl.png").targetOffset(-174,-17)) wait(3) type( u"\ue005") wait(1) click(Pattern("SaveCircuitD-1.png").targetOffset(-128,1)) wait(2) -- You received this question notification because you are a member of Sikuli Drivers, which is an answer contact for Sikuli. ___ Mailing list: https://launchpad.net/~sikuli-driver Post to : sikuli-driver@lists.launchpad.net Unsubscribe : https://launchpad.net/~sikuli-driver More help : https://help.launchpad.net/ListHelp
Re: [Sikuli-driver] [Question #270082]: Calling a data from TXT file
Question #270082 on Sikuli changed: https://answers.launchpad.net/sikuli/+question/270082 Status: Answered => Open Anurag is still having a problem: Thanks for the revert Raiman!! Yes it solve my problem some extent I need to call data from other txt also, I already tried the same thing that you suggest but nested for loop is not working , It works fyn for a one go but for the next time it comes on the second FOR loop instead of going again on first one. Is there any mean like i can call the first loop. -- You received this question notification because you are a member of Sikuli Drivers, which is an answer contact for Sikuli. ___ Mailing list: https://launchpad.net/~sikuli-driver Post to : sikuli-driver@lists.launchpad.net Unsubscribe : https://launchpad.net/~sikuli-driver More help : https://help.launchpad.net/ListHelp
Re: [Sikuli-driver] [Question #270082]: Calling a data from TXT file
Question #270082 on Sikuli changed: https://answers.launchpad.net/sikuli/+question/270082 Description changed to: Hello guys, I need some urgent help from you guys, Actually i need to call a data from notepad line by line according to my usage say if txt looks like name Anurag age 12 sex male. name Lokesh age 24 sex male. name Ashu age 23 sex male. and so on i like to call name in script, it should reflect as Anurag and age as 12 and sex as male. for the second time it should reflect lokesh, 24 and male so on. Please help me i really need this. thanks in advance. -- You received this question notification because you are a member of Sikuli Drivers, which is an answer contact for Sikuli. ___ Mailing list: https://launchpad.net/~sikuli-driver Post to : sikuli-driver@lists.launchpad.net Unsubscribe : https://launchpad.net/~sikuli-driver More help : https://help.launchpad.net/ListHelp
Re: [Sikuli-driver] [Question #270082]: Calling a data from TXT file
Question #270082 on Sikuli changed: https://answers.launchpad.net/sikuli/+question/270082 Description changed to: Hello guys, I need some urgent help from you guys, Actually i need to call a data from notepad line by line according to my usage say if txt looks like name Anurag age 12 sex male. name Lokesh age 24 sex male. name Ashu age 23 sex male. and so on i like to call name in script, it should reflect as Anurag and age as 12 and sex as male. for the second time it should reflect lokesh, 24 and male so on. Please help me i really need this. thanks in advance. Thanks for the revert. Yes it solve my problem some extent I need to call data from other txt also, I already tried the same thing that you suggest but nested for loop not working , It works fyn for a one go but for the next time it comes on the second FOR loop instead of going again on first one. Is there any mean like i can call the first loop. -- You received this question notification because you are a member of Sikuli Drivers, which is an answer contact for Sikuli. ___ Mailing list: https://launchpad.net/~sikuli-driver Post to : sikuli-driver@lists.launchpad.net Unsubscribe : https://launchpad.net/~sikuli-driver More help : https://help.launchpad.net/ListHelp
Re: [Sikuli-driver] [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: lines = open("notepad file.txt").readlines() for line in lines: fields = line.split() name = fields[1] age = fields[3] sex = fields[5] if you need age as number: age = int( fields[3]) -- You received this question notification because you are a member of Sikuli Drivers, which is an answer contact for Sikuli. ___ Mailing list: https://launchpad.net/~sikuli-driver Post to : sikuli-driver@lists.launchpad.net Unsubscribe : https://launchpad.net/~sikuli-driver More help : https://help.launchpad.net/ListHelp