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

Hi PLZ explain User Defined Functions in QTP with eample?

2 Answers   Ordain Solutions,


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?

0 Answers  


What is the limitation to XML Checkpoints?

0 Answers  


What is a Web Table?

5 Answers   Kanbay,


how to use import and export sheet methods in qtp

1 Answers  






Where we use data driver in qtp?

0 Answers  


1. How to capture data from images in QTP and produce them in Excel sheet

1 Answers   Broadridge,


How do i relate the checkbox properties with webelement when checkbox properties are changing on every login to the application

1 Answers   TCS,


How to make arguments optional in a function?

1 Answers   IBM,


What are the data types in qtp?

0 Answers  


Hi, i want download attached files in test plan area from QC to local drive in my system using QTP script. Please help me

3 Answers  


How we can merge the object repositories?say if we have two or three object repositories then how e can merge them? is there any option in Qtp to merge the object repositories

5 Answers   BirlaSoft,


Categories