Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to retrieve specied string from text file
#2
Solved: 9 Years, 5 Months, 2 Weeks ago
Hi Team, I found the solution
Sample.txt contains the above content
Code:
Dim fso
Set fso = CreateObject("Scripting.FileSystemObject")
Set objTxtFile = FSO.OpenTextFile("C:\Users\Suresh\Desktop\sample.txt")
i=0
Do Until objTxtFile.AtEndOfStream
sContent = objTxtFile.ReadLine
sContent= replace(sContent,"<sourceid>","sourceid=")
sContent= replace(sContent,"</sourceid>","@sourceid")
a=instr(sContent,"=")
a=a+1
b=instr(sContent,"@")
c=b-a
sContent=Mid(sContent,a,c)
print sContent
i = i+1
Loop
Hope it will help someone
Reply


Messages In This Thread
RE: How to retrieve specied string from text file - by nsuresh316 - 06-09-2015, 12:24 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Error as Global Not defined while trying to retrieve value from Datatable siddharth1609 0 958 09-11-2019, 02:52 PM
Last Post: siddharth1609
  Cannot retrieve Native property JeL 1 1,069 07-29-2019, 05:41 PM
Last Post: JeL
  Need to Validate Text filed is blank after clicking on the Text box balak89 3 4,892 09-13-2015, 12:06 AM
Last Post: ADITI1992
  To retrieve content of a WEBEDIT object alpha1 2 2,597 06-11-2015, 11:21 AM
Last Post: vinod123
  Retrieve row number based on value in DataTable marfa 6 30,724 07-31-2014, 08:36 PM
Last Post: dharshinishankari@gmail.com

Forum Jump:


Users browsing this thread: 1 Guest(s)