• J
    Jerrod Tanner

    @mattfox thanks so much for the help, I made a silly mistake but I am glad it made me more familiar with Mango. I ended up crafting quite the nice CSV importer with some bells and whistles.

    posted in User help read more
  • J
    Jerrod Tanner

    0_1593712964341_4663f5f5-5153-4a33-9864-e5aa6c5d967f-image.png

    public class MultiColumnCsvImporter extends AbstractCSVDataSource {
    	
    	private Map<Integer, String> headerMap = new HashMap<Integer, String>();
    	
    	
    	@Override
    	public void importRow(String[] row, int rowNum) {
    		//Strip out the header row, it does not contain our data
    		if(rowNum == 0){
    			for(int k = 0; k < row.length; ++k) {
    				this.headerMap.put(k, row[k]);
    			}
    		}else{
    			
    			//Column 0 is the time
    			Integer Id = Integer.parseInt(row[0]);
    			
    			//Empty additional parameters
    			Map<String, String> extraParams = new HashMap<String,String>();
    			
    			//For each additional column we will create an Import Point
    			for(int i=1; i<row.length; i++){
    				String identifier = headerMap.get(i); //Get the identifier from our header map
    				double value = Double.parseDouble(row*); //Create the value
    				NumericImportPoint point = new NumericImportPoint(identifier, value, Id, extraParams);
    				this.parsedPoints.add(point);
    			}
    		}
    	}
    }
    

    0_1593713145809_d3c57461-9762-4b63-8144-943d22f41b85-image.png

    So here you can see data points for only the last row.

    posted in User help read more
  • J
    Jerrod Tanner

    Hi, I am very new to Mango and have been working on taking CSV files and making their columns into data points. I used the default multi column CSV importer which works fine, I get my columns as data points inside my CSV data source in Mango. My issue is that it will only create points for the last row. How can I get all or even a select few rows?

    posted in User help read more