Create an Excel file and pass the values from Flat File? (for ex:data1.txt,data2.txt )
Answer Posted / prashant puranik
'programme to transfer the data from notepad to excel
Dim fso,myfile,i,row
i=1,row=0
Set fso=Createobject("Scripting.filesystemobject")
Set myfile=fso.OpenTextFile("G:QTP Examplesqtpexamplefile2.txt",1,True)
Datatable.AddSheet("Puranik")
Datatable.GetSheet("Puranik").AddParameter "Prashant" ," "
Do While myfile.AtEndOfStream <> true
row=row+1
Datatable.GetSheet("Puranik").SetCurrentRow(row)
Datatable.Value("Prashant","Puranik")=myfile.ReadLine
Loop
Datatable.Export("G:QTP Examplesqtpexample_file1.xls")
'Programme to transfer the data from excel file to notepad
Dim fso,i,myfile
Datatable.AddSheet("mysheet")
Datatable.ImportSheet "G:QTP Examplesqtpexample_file2.xls","Sheet1","mysheet"
row=Datatable.GetSheet("mysheet").GetRowCount
Set fso=Createobject("Scripting.filesystemobject")
Set myfile=fso.OpenTextFile("G:QTP Examplesqtpexamplefile3.txt",2,True)
For i=1 to row
Datatable.GetSheet("mysheet").SetCurrentRow(i)
myfile.WriteLine(Datatable.Value("Anuj","mysheet"))
Next
Set myfile=nothing
Set fso=nothing
| Is This Answer Correct ? | 2 Yes | 0 No |
Post New Answer View All Answers
How does QTP identify an object?
Explain the features and benefits of quick test pro(qtp)?
Which environments does qtp support?
What are the data types in qtp?
Plz Explain AUTOMATION REFERENCE MODEL?
What are parameterizing tests?
In what occasion we can specify global sheet and action sheet?
how u will evaluate the tool for test automation?
why should we give deliver good quality software?
how do u plan test automation?
There is an excel file of 1 to 100 sheets how you will iterate through it?
If I change the property value at runtime is it effect is object repository?
What are the types of data tables in qtp?
Is QTP Supports SWT applications? If yes, can you write a sample script for opening a new package in eclipse.
Pls can anybody send me the Recent Technical and Interview Questions Which were asked in IBM(QTP)Automation PLZZZZZZZZZ