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
In qtp, how you can use xpath to identify objects?
What are the methods of the TextStream object that are used for reading from a text file?
How can we conduct U-I Testing by using QTP??????
HOw to add the recovery file at runtime to the test file .
what is the diff between manual test plan document and automation test plan doc.can u explain indetail.
What is quicktest professional (qtp window?
What is the extension of the qtp local repository?
How to do the scripting. Are there any inbuilt functions in QTP? What is the difference between them? How to handle script issues?
How to data driven test for Win objects in QTP ?
what is the difference between IE & Netscape in web testing on a log in page
how to compare two bitmaps( 1. clients requirement & 2. Designed by dev) in qtp 8.2 wann clear steps
How to find the name of the machine where you are running your automation scripts in qtp?
when will you do debug your script? and explain that process?
why you have standardized functions? plzzz guys with real time exp. do answer
How can i use virtual objects? If have i created one new virtual object in a virtual object manager by following instructions.