Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

I want to open a text file and then search some specified
text in it and then replace that text with some other text
i found that text in .txt but do not know how to replace
that text can any body help me. if possible put the code
for qtp

Answer Posted / rico

Const ForReading = 1, ForWriting = 2
Dim fso, f
Set fso = CreateObject("Scripting.FileSystemObject")
Set f = fso.OpenTextFile("c:\working\replace.txt",
ForWriting, True)
f.Write "QTP QTP RFT QTP QTP RFT QTP QTP"
Set f = fso.OpenTextFile("c:\working\replace.txt",
ForReading)
ReadAllTextFile = f.ReadAll
newText = Replace( ReadAllTextFile, "QTP", "QTPRO")
Set textFile = fso.OpenTextFile
( "C:\working\replace.txt", ForWriting )
textFile.WriteLine newText
f.Close

Is This Answer Correct ?    12 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

A FORM CONTAINS 5 FIELDS. 1 FIELD IS ENABLED REMAINING(4) FIELDS DISABLED. MY QUESTION IS ENTER VALUES INTO 1 FIELD AFTER THAT CLICK TAB BUTTON THEN 2 FIELD ENABLE THIS PROCESS CONTINUE UPTO 5TH FIELD. HOW TO WRITE CODE IN DESCRIPTIVE PROGRAMMING. PLZ TELL ME THE PROCEDURE AND CODE FOR IT.

1793


How many ways is to parameterize the value?

1183


What is the syntax to call one action in another?

1092


What is system testing and what are the different types of tests you perform in system testing?

1219


What are the benefits of quick test pro(qtp)?

1032


How you calling actions in qtp?

1097


what is actually contain test report? can anybody post the test report

2039


Will there be any standards or requirements for page appearance and/or graphics throughout a site or parts of a site?

1080


How to start recording using quicktest professional?

1245


Through array we can execute the testcase how ? give me example

1954


What is recovery scenario manager? When you go for recovery scenario manager?

1089


How can i initiate the objects to find uniquely in OR

1946


This is a question thats generally asked in every QTP interview. What were the problems that you faced during automation and how did you resolve them?

1973


How many types of run modes are there in qtp?

1073


Have you used xml check point in your project?

1014