I have been tweaking an existing HS3 script from this forum to parse my utility company's regularly changing CSV file. It reports meter data from multiple sites in our portfolio. I am trying to parse just the data from one specific site to set device values and email. I was successful using the following Split String script below for a few days as the site data I wanted was the first line in the CSV but then I noticed the meter provider would change my site ID to another row in the CSV file but the column data was the same attributes. Essentially I was reporting on another site for a couple of days before I noticed.
Now I am searching to find a way in the script to search and match the site ID number 657772 that is always in the first column and then parse specific variable data for that row only. Is this possible and if so I could sure use some help as I have exhausted trying different methods but cant quite come up with anything that works.
Thank you for any help.
Will
Now I am searching to find a way in the script to search and match the site ID number 657772 that is always in the first column and then parse specific variable data for that row only. Is this possible and if so I could sure use some help as I have exhausted trying different methods but cant quite come up with anything that works.
Code:
Imports System.IO Sub Main(ByVal Parm As Object) Dim SplitLine() As String = System.IO.File.ReadAllLines("D:\Meterdata\SiteID_657772\Export.csv") Dim SplitChars1() As String = SplitLine(1).Split(",") *my site data used to be in first line hs.writelog("MV", SplitChars1(12)) 'volts hs.writelog("MKW", SplitChars1(13)) 'KW hs.writelog("MKVA", SplitChars1(14)) 'KVA hs.writelog("MKWH", SplitChars1(15)) 'KWH hs.setdevicevaluebyref(3746, SplitChars1(12), True) hs.setdevicevaluebyref(3747, SplitChars1(13), True) hs.setdevicevaluebyref(3748, SplitChars1(14), True) hs.setdevicevaluebyref(3749, SplitChars1(15), True) End sub
Will
Comment