23-10-21, 06:45 AM
كود :
Dim kml As String = IO.File.ReadAllText("TextFile1.txt")
Dim Regex As New System.Text.RegularExpressions.Regex("<\s*coordinates[^>]*>(.*?)<\s*/\s*coordinates>", System.Text.RegularExpressions.RegexOptions.Singleline)
Dim results As New Text.StringBuilder
For Each m As Text.RegularExpressions.Match In Regex.Matches(kml)
Dim coordinates As String = m.Value
coordinates = coordinates.Replace("<coordinates>", "").Replace("</coordinates>", "").Trim
For Each Line In coordinates.Split(vbNewLine)
results.Append(Line.Trim)
results.Append(vbNewLine)
results.Append("-----------------------------")
results.Append(vbNewLine)
Next
Next
MsgBox(results.ToString)