Announcement

Collapse
No announcement yet.

How can I parse this text file in VB.NET?

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • How can I parse this text file in VB.NET?

    I am currently using an old vbscript to parse the attached clip of a text file to update HS3 devicestrings from the GPS coordinates on separate lines 71 & 72. Recently with the help of Sparkman and Mr Happy I now have a functioning script using Bing to perform a reverse location of LAT/LON coordinates to populate a device with an address.

    Ideally I would like to parse this text file using VB NET to search the lines for the latitude and longitude and parse the GPS coordinate integers only and populate HS3 devicevalues in order to pass to my new Bing Reverse GPS script.

    I have worked on this all day and can't seem to get close enough. Its evident I am green to scripting and usually figure out by a lot by reading and trial and error but this one has me stumped.

    I appreciate any help. Thanks


    Click image for larger version

Name:	INI.JPG
Views:	1
Size:	20.4 KB
ID:	1267052

  • #2
    It looks like the syntax is the same as an INI file so I bet the built-in HS commands to read from an INI file will work:

    Code:
    Dim Latitude As String = hs.GetINISetting("DRIVESTATE", "latitude", "", "filename.ext")
    Dim Longitude As String = hs.GetINISetting("DRIVESTATE", "longitude", "", "filename.ext")
    By default HS expects the file to be in Config folder, but you should be able to reference the actual location.
    HS 3.0.0.523: 1984 Devices 1111 Events
    Z-Wave 3.0.1.256: 114 Nodes on one Z-Net

    Comment


    • #3
      Hey Al once again you come to the rescue. That works perfectly! Next time I will reach out before I spend so much time.

      Thank you!

      Will

      Comment


      • #4
        Glad that worked for you Will!

        Cheers
        Al
        HS 3.0.0.523: 1984 Devices 1111 Events
        Z-Wave 3.0.1.256: 114 Nodes on one Z-Net

        Comment

        Working...
        X