Option
Explicit
Sub
Test()
Dim
r
As
Object
Dim
vnt
As
Variant
Dim
i
As
Long
Set
r = CreateObject(
"VBScript.RegExp"
)
r.IgnoreCase =
True
r.Global =
False
r.MultiLine =
False
vnt =
"G:\data\127020.xml"
i = FreeFile
Open vnt
For
Input
As
#i
vnt = StrConv(InputB(FileLen(vnt), #i), vbUnicode)
Close #i
While
InStr(1, vnt, vbCr) > 0
Or
InStr(1, vnt, vbLf) > 0
vnt = Replace$(Replace$(vnt, vbCr,
""
), vbLf,
""
)
Wend
r.Pattern =
"<data>(.*)</data>"
Set
vnt = r.Execute(vnt)
If
vnt.Count > 0
Then
vnt = Split(vnt(0).SubMatches(0),
","
)
If
UBound(vnt) > 3
Then
For
i = 3
To
UBound(vnt)
vnt(i - 3) = Right$(vnt(i), Len(vnt(i)) - InStr(1, vnt(i),
"x"
))
If
i > UBound(vnt) - 3
Then
vnt(i) =
""
Next
With
Worksheets(
"Tabelle1"
).Range(
"A1"
).Resize(UBound(vnt) - 3)
.NumberFormat =
"@"
.Value = WorksheetFunction.Transpose(vnt)
End
With
End
If
End
If
End
Sub