Something like....
import java.text.SimpleDateFormat; import java.util.HashMap; import java.util.Map; import org.apache.commons.lang3.StringUtils; import com.infiniteautomation.datafilesource.contexts.AbstractCSVDataSource; import com.infiniteautomation.datafilesource.dataimage.NumericImportPoint; public class JergForumCsvQuestion extends AbstractCSVDataSource { private boolean headersConsumed = false; private SimpleDateFormat dtf = new SimpleDateFormat("yyyy-MM-dd HH:mm"); @Override public void importRow(String[] data, int rowNum) { if(data.length == 0) return; Map<String, String> extraParams = new HashMap<>(); String[] rowData = data[0].split(";"); if(rowData.length < 7) //avoid index out of bounds return; try { //subtract the timezone, or you could put it into the date formatter (or add the timezone, //it's not always easy to know if they're saying those times are in UTC-5 or those times are UTC) long time = dtf.parse(rowData[3]).getTime() - 5*60*60*1000; this.parsedPoints.add(new NumericImportPoint("PV Solar kWh", Double.valueOf(rowData[5]), time, extraParams)); this.parsedPoints.add(new NumericImportPoint("PV Solar W/m^2", Double.valueOf(rowData[6]), time, extraParams)); } catch(Exception e) { System.out.println("Exception: " + e.getMessage()); } } }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.
J