How can i open a file in Textpad and replace a string with
another using QTP



How can i open a file in Textpad and replace a string with another using QTP..

Answer / madhavi

FileLocation="C:\Documents and Settings\\Desktop\file1.txt"

Set fso=CreateObject("Scripting.FileSystemObject")
Set fl=fso.OpenTextFile(FileLocation)
txtToReplace=replace(fl.ReadAll,"QTP","QTP9.5")
fl.Close

Set fl=fso.OpenTextFile(FileLocation,2)
fl.Write(txtToReplace)
fl.Close

Is This Answer Correct ?    5 Yes 4 No

Post New Answer

More QTP Interview Questions

how to parameterizing values from an excel sheet in Quick test professional?

1 Answers  


How QTP recognizes Objects in AUT?

1 Answers   Crea,


What are the things(properties, and other details) will be recorded while recording an object using normal recording?

0 Answers  


How can i select multiple items from a WebList bOX USING QTP

3 Answers   DuPont, Syntel,


How to Test the mainframe application?

0 Answers   Unisys,






Which functionalities of QTP used in banking project? pls any say answer?

0 Answers  


Where to use Property Let, Property Get, Property Set in UFT

0 Answers  


What is the difference between Global and Local Data Sheets?

1 Answers  


results.xls file is automatically generated while running the script in QTP.But it is showing error to open the file

1 Answers  


Explain more about the Test Fusion Report of QTP?

0 Answers  


what is framework in QTP? any one give me answer

4 Answers   Wipro,


How to add multiple values in rows, under a single column of a run time datatable?

3 Answers   NIIT,


Categories