uniVocity-parsers is a suite of extremely fast and reliable parsers for Java. It provides a consistent interface for handling different file formats, and a solid framework for the development of new parsers.
format1.setLineSeparator("\n");
String inp = "Value Relative Humidity\n''\n''";
CsvParserSettings settings1 = new CsvParserSettings();
settings1.setFormat(format1);
settings1.setNormalizeLineEndingsWithinQuotes(true);
settings1.setHeaderExtractionEnabled(true);
CsvParser parser1 = new CsvParser(settings1);
List<String[]> parsedRows1 = parser1.parseAll(new StringReader(inp));
for (String[] array : parsedRows1){
for (String s : array){
System.out.println(s);
}
}
The string in the code has a single header followed by single quote values.
Expected output of header row is Value Relative Humidity but actual output got is [Value, Relative, Humidity]