Micro Focus QTP (UFT) Forums
write to text file - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: UFT / QTP Beginners (https://www.learnqtp.com/forums/Forum-UFT-QTP-Beginners)
+--- Thread: write to text file (/Thread-write-to-text-file)



write to text file - qtpguy07 - 02-02-2010

Hi

Can some one help me how to write to a data from application to a text file.
For Example, in my global sheet I have a list of User names and Passwords which I will enter and I will get phone number when I log in. I need to write all phone numbers to a text file.

I used GetRoproperty to extract phone number and when I use FSO to write to the text file, only last phone number is getting stored in text file . previous numbers are getting overwritten.


RE: write to text file - manabh - 02-02-2010

Hi,
For opening the file for 1st time, create it. Then always open it in Append mode, provided you are opening & closing this text file.
If you are keeping it open, then open it in append mode & then write the text into the file.


RE: write to text file - qtpguy07 - 02-02-2010

Hi Manoj

Thanks for your reply. can you give me a function how to open it with appand mode second time

Thanks