write code to read and write data from file?



write code to read and write data from file?..

Answer / rdshet

Hi,

Set fso = CreateObject("Scripting.FilesyStemObject")
Set fil = fso.CreateTextFile("D:\test.txt", TRUE)
fil.writeline "this is text 1 " ' Writing
fil.writeline "this is text 2 "
fil.writeline "this is text 3 "
fil.close

IF fso.FileExists("D:\test.txt") =TRUE Then
Set fil1 =fso.OpenTextFile ("D:\test.txt",1)

DO WHILE NOT fil1.atendofstream
flread = fil1.ReadLine 'Reading
msgbox flread
LOOP
flread.close
Set flread = NOTHING
END IF

Set fil = NOTHING
Set fso = NOTHING


Regds
Raghavendra

Please correct me if am wrong.

Is This Answer Correct ?    2 Yes 1 No

Post New Answer

More QTP Interview Questions

How to find array size in qtp?

0 Answers  


want to learn real time automation project(QTP)?

1 Answers  


How to use Regular Expressions in QTP

1 Answers  


What is QTP?

3 Answers   Crea,


why use Description programming? what is advantages and disadvantage of this methods?

2 Answers  


how interviews will be on QTP?

0 Answers   Fidelity,


what is the main process in QTP?

3 Answers   Ordain Solutions,


HOW to invoke any recorded script in QTP with out using RECORD & PLAYBACK CONCEPT?

1 Answers  


WHAT IS ENVIRONMENT VARIABLES?

7 Answers   AZTEC, CTS, Ready Test Go,


Take a situation when you are working with QTP, suddenly system has crashed.so you again start the system. My questyion is how can QTP directly opened when the system desktop appears.

1 Answers  


what will be there in keyword view and expert view?

2 Answers  


What is Curd testing?

0 Answers   Wipro,


Categories