Showing posts with label QTP Script to Find and Replace Text in a Text File. Show all posts
Showing posts with label QTP Script to Find and Replace Text in a Text File. Show all posts

QTP Script to Find and Replace Text in a Text File-VB Script to Find and Replace Text in a Text File


QTP Script to Find and Replace Text in a Text File



Const ForReading = 1



Const ForWriting = 2



Set fso = CreateObject( "Scripting.FileSystemObject" )



Set textFile = fso.OpenTextFile( "C:\qtp.txt", ForReading )



Text = textFile.ReadAll



textFile.Close



NewText = Replace( Text, "abc", "QTP")



Set textFile = fso.OpenTextFile( "C:\qtp.txt", ForWriting )



textFile.WriteLine NewText





Related Posts Plugin for WordPress, Blogger...

Fun and Knowledge