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 / kartheek
'try this cpde
Set fso = createobject("scripting.filesystemobject")
Set f = fso.OpenTextFile("C:\Documents and
Settings\kartheek\Desktop\Dummy.txt",1)
var1=f.ReadLine
k=1
var2=split(var1,",")
datatable.AddSheet("dummy")
datatable.GetSheet("dummy").AddParameter "country",""
datatable.GetSheet("dummy").AddParameter "number1",""
For i = 0 to ubound(var2)
datatable.GetSheet("dummy").SetCurrentRow(k)
If isnumeric(var2(i)) Then
datatable.GetSheet("dummy").GetParameter("number1").Value=var2(i)
k=k+1
else
datatable.GetSheet("dummy").GetParameter("country").Value=var2(i)
End If
Next
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
When Recovery scenario actually starts while testing the application?
what is ODC and GDC?
can anyone tell me from where i can download qtp demo or crack version
For which type of projects the iterative model is not suitable?
Can an action have 2 shared object repositories associated with them? In that case, if two of them contain the same object, which one will be considered?
Explain about the quicktest professional (qtp) automation object model?
Can any one tell me.......How the test engg's start testing in the compy environment.....real time tester PLSSSS help me i need in depth information regarding this...
In application which areas to be automated and what kind of situation will be take? using QTP? Plz give me the clear answer
What is Curd testing?
What is the default add-ins in qtp?
Where to use function or action?
How can i use virtual objects? If have i created one new virtual object in a virtual object manager by following instructions.
Hi All, I have QTP installed on my machine but the application under test is on remote machine. I need to automate the scenarios which consist of automatically enter the remote machine through IP address ,record the application in remote machine and run it also when played. Can some one tell how to record the application in remote machine.
How to run an integrated test scenario using Multiple Actions? How to use the QTP Step Generator?
how to find that tools work well with ur existing system?