Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
XML Data read and extract output in an array
#6
Solved: 11 Years, 3 Months, 4 Weeks ago
All good ? Smile

Code:
Set objFileToRead = CreateObject("Scripting.FileSystemObject").OpenTextFile("C:\testme.txt",1)
strFileText = objFileToRead.ReadAll()
objFileToRead.Close
Set objFileToRead = Nothing
ToolNode = Split(Trim(Split(Split(strFileText,"<TOOL>")(1),"</TOOL>")(0)),vbNewLine)

BookNode = Split(Trim(Split(Split(strFileText,"<BOOK>")(1),"</BOOK>")(0)),vbNewLine)

For intBCounter = Lbound(BookNode) to Ubound(BookNode)
  If Len(BookNode(intBCounter)) <> 0 Then
    msgbox Split(BookNode(intBCounter),"</")(0)
  End If
Next

For intTCounter = Lbound(ToolNode) to Ubound(ToolNode)
  If Len(ToolNode(intTCounter)) <> 0 Then
    msgbox Split(ToolNode(intTCounter),"</")(0)
  End If
Next
Hopefully this helps, let me know if you need any clarifications.
Basanth
Give a fish to a man and you feed him for a day..Teach a man how to fish and you feed him for life.
Reply


Messages In This Thread
RE: XML Data read and extract output in an array - by basanth27 - 04-09-2013, 03:19 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  How to extract particular digit from a string amit25007 3 3,484 10-05-2016, 10:49 AM
Last Post: Ankur
  Reading XML Data from a WebPage shaan.mishra87@gmail.com 1 2,222 09-28-2016, 09:16 PM
Last Post: supputuri
  table output values shipu 1 2,342 01-24-2014, 10:06 AM
Last Post: supputuri
  How to extract part of a string between two particular characters. ACCBAJPA 7 5,787 08-22-2013, 02:39 PM
Last Post: ACCBAJPA
  Getting an 'Error in XML document' Error when submitting web services XML luckyexpert 0 3,134 08-20-2013, 10:23 PM
Last Post: luckyexpert

Forum Jump:


Users browsing this thread: 2 Guest(s)