Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect header parsing #519

Open
moibra opened this issue Mar 2, 2023 · 0 comments
Open

Incorrect header parsing #519

moibra opened this issue Mar 2, 2023 · 0 comments

Comments

@moibra
Copy link

moibra commented Mar 2, 2023

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]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant