i have .xls,.txt,.doc files are there (together). i want
find only .xls file among them? how can we write function?

Answer Posted / kamesh

using the extention (.xls) in code..see below code
Here i open the file from mentioned path and read and write
the values on that.


Set fso = CreateObject("Scripting.FileSystemObject")
Set f = fso.OpenTextFile("c:\DIM.txt", 1, True) ' open to
empty file and also use for open the file which is already
created
WriteLineToFile = f.ReadAll 'Read all the file line to
line
msgbox WriteLineToFile

Set MyFile1 = fso.CreateTextFile
("c:\kamesh.txt",True) 'create new empty file
MyFile1.WriteLine WriteLineToFile ' Write all the stuf
in created file
MyFile1.Close

Is This Answer Correct ?    0 Yes 5 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

what is the advantages and disadvantages of using functions instead of re usable actions

1659


How to define array in qtp?

771


How does qtp recognize objects in aut?

785


When QTP object wait time is 10 seconds, and in test script wait time is 5 seconds and in function library wait time is 2 seconds how much time does the wait occur? or which is given priority.

1892


how to idetfy which test cases are automated?who will deside that plz tell me

1759


Presently i am working on QTP 8.2 Version,i want to know features in 9.2 version, because i have not sufficient time to put the effort on the 9.2 version

1610


"What are the common constrains that we need to consider when we prepare testcases for ASP application". Thanks in Advance...

1689


How to test the login page in different ways in automation testing and i need code?

1564


Hi All, I Want To excute scripts batch without using QC .I need code for that Thanks Balaji

1554


What is a recovery scenario?

793


How to find operating system information using the qtp script?

817


What is the difference between shared and local object repository?

826


What is parameter in qtp?

854


How do you convert manual test cases to automated test cases?

789


what is the difference between data driver & data driven and driver script?

2430