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
i can done the project with QTP in that time i can say how many members in my team size?
Why do we use "Text checkpoint" If we can make use of it in "standard checkpoint" ?
How you calling actions in qtp?
Do you know SQL? I know SQL but i don't have any experience...that's it..No more questions ...simply he said " you can leave for the day" ...guys prepare SQL Quires before attending interview in bank of america...
Can the user toggle between using Local OR and shared OR for the same action?
How you can write contexts to text file in qtp?
what is the difference betn QTP 8.0 AND PREVIOUS VERSION
I want to know what are QTP functons and what are VB script functions. What is the difference between them.When we have to use these functions.
how can we do the frame work in qtp
you are recording on "WINDOW 1", say it has a link if you click on that, that leads you to "WINDOW 2". If you do any manipulations on "WINDOW 2" that are automatically updated in to "WINDOW 1". But "WINDOW 1" is currently invisible. But the updations in "WINDOW 1" must also be recorded as a script in QTP. The best Example is if you update your resume in JOB STREET portal it actually happens in other window, but the previous window is automatically updated. Now does QTP help you in this types of situations? Any body can answer this question. please..... Siva
Is it possible to use two instances of UFT on the same machine? If not why?
Explain about the test fusion report of quicktest professional?
What is the use of sendkeys and what are send keys
In qtp, how you can remove the spaces from string?
If I give some thousand tests to execute in two days what do you do?