Please Note This forum exists for community support for the Mango product family and the Radix IoT Platform. Although Radix IoT employees participate in this forum from time to time, there is no guarantee of a response to anything posted here, nor can Radix IoT, LLC guarantee the accuracy of any information expressed or conveyed. Specific project questions from customers with active support contracts are asked to send requests to support@radixiot.com.
Help building a csv import class
-
Hi guy's
i am reading the mang help file about csv class. It is really not clear for me.
I have this file see attachment link text
With powershell i selct the file of today and copy the file in to another directory with a new name that is always the same so mango can findthe file.
I would like to use the last line that is written for my data points.The system status is written at the end of the log period
That needs to be read as well for the datapoint,can some one help me with the csv import class file ?
thanks in advanced
-
@sprokkie
Are you referring to the Data File Data Source?If you only want the last row, you'll either want to know how many rows there are and generate the list of import points on then, or create a new 'parsedPoints' list at each row. The abstract "importRow" method will give you one line of Strings split by commas. Loop over the values in the array, and for each one
this.parsedPoints.add(new AlphanumericImportPoint( "Point number: " + n, data[n] , now.getTime() ));
You can find a good example in the module's folder inside your Mango. Mango/web/modules/dataFile/web/CompilingGrounds/CSV