Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Read text from text file and save it into a variable in qtp
#1
Solved: 10 Years, 10 Months, 2 Weeks ago
Hi Guys,

I've a text file(data) which has 3 lines as following:

ABC
DEF
XYZ

I'm reading the text file using the following command:
Code:
Const ForReading = 1
Set fso = CreateObject("Scripting.FileSystemObject")
    s1="C:\temp\data.txt"
   Set theFile = fso.OpenTextFile(s1, ForReading, False)
   Do While theFile.AtEndOfLine <> True
      retstring = theFile.ReadLine
      msgbox retstring
      Loop
   theFile.Close

Now, i want to store the 3 values from text file into 3 variables in qtp.
For example,
V1=ABC
V2=DEF
V3=XYZ

Can somebody please help me out??
Reply


Messages In This Thread
Read text from text file and save it into a variable in qtp - by arpan - 06-19-2013, 12:28 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Capture All text from webpage and copy it... mpatra 3 4,910 07-25-2018, 05:33 PM
Last Post: vimlesh
  LearnQuickTestPDF -does not work on just getting the text jloyzaga 0 1,184 02-10-2017, 10:59 AM
Last Post: jloyzaga
  How to edit a text in aParagraph shaan.mishra87@gmail.com 2 2,372 08-26-2016, 04:48 PM
Last Post: shaan.mishra87@gmail.com
  How to update CSV File and need to Save same CSV File kotaramamohana 1 3,322 10-24-2015, 08:40 AM
Last Post: tigerliew
  Not able to click the save button in Save As window while downloading from SAP kathirvelnagaraj 0 2,301 08-25-2015, 07:37 PM
Last Post: kathirvelnagaraj

Forum Jump:


Users browsing this thread: 3 Guest(s)