How do u retrieve data from a text file into different
variables. i.e.
in a text file named "source" , the data is like :
india,1000,japan,200,china,50,singapore,45050
this is given in the first line of the text file.
in the second line of the text file the dta is:
sun,moon,planet,river,earth,water
if u use "readline" method by using FSO concept u can
retrieve the entire line in to a variable. but i want to
import each field (ex: "india" in one variable, "1000" in
another variable etc..). Apprecitae proper replies.
Answer Posted / vipin eden ispl
set fso=createobject("scripting.filesystemobject")
set f=opentextfile(path,1)
set a=new regexp
a.pattren="[a-z]+|(\d)+"
a.ignorecase=true
a.global=true
do while f.atendofstream <>true
r=f.readline
set b=a.execute(r)
for each val in b
msgbox val
next
loop
f.close
dz will get u much information later u can modify as per ur
requriment.
| Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
What is keyword driven framework?
can u explain the keyword driven framework with an example clearly how to create all the files and how to attach to main test.
Why qtp always start action1 and does not start action?
What are the advantages of qtp?
what is meant by source control?
hi can any body give me a script for creating a modularity or keyword driven framework..i am working as a qtp tester for 2 months but still i am not exposed to framework in my company
Hi friends did any budy attend accenture system test for qtp? if any budy pls drop questions.not only accenture any other mnc company which you attended system test(QTP)?it may helpful to others also
I am Facing Issues with learing datepicker 1)when i first learn datepicker as current system date . 2)if i wanna runtime datepicker value it gives error
any body can you help me what is the script to automate an comand promt
suppose i login into gmail page after that i read all the messages (say 10 messages) i have to send (SAVE) the messages in Html,notepad and i have to replay(Compose) send the messages please give me the code and give mail id so that i can clear my question
What are the different ways to invoke an application using QTP?
How to add object to object repository in qtp9.0 Suppose for brower yahoo home page
Where we use data driver in qtp?
How are actions and functions different in QTP?
What is environment variable in qtp and why to use it?