Wednesday, July 13, 2011

How to read contents from a file and write into the another file in QTP?

Dim, fso, file1, file 2, x

Set fso = Createobject("scripting.filesystemobject")
set file1 = fso.opentextfile("C:\Skhan\sk1.txt")
set file2 = fso.createtextfile("c:\skhan\sk2.txt")

Do Until fso.AtEndOfstream = True
x = file1.readline
file2 = writeline.x
Loop

File1.close
File2.close

Set fso.Nothing



Thanks,
Shahadat Khan

No comments:

Post a Comment