我想解析一個使用Univocity CSV引號的CSV,我發現在解析某些值時缺少關閉引號。Univocity CSV:解析後缺少引號
CSV:
ACCT,NAME,AGE,ADDRESS
700,GINI,23,"AB,ECITY-1"
800,HANNAH,30,"AB,ECITY-1"
900,IAN,40,"XYZ,ECITY-1"
1900,LYDIA,40,"XYZ,ECITY-1"
輸出:
[GINI, "AB,ECITY-1]
[HANNAH, "AB,ECITY-1]
[IAN, "XYZ,ECITY-1]
[LYDIA, "XYZ,ECITY-1]
CsvParserSettings settings = new CsvParserSettings();
settings.getFormat().setLineSeparator("\n");
settings.setKeepQuotes(true);
settings.setQuoteDetectionEnabled(false);
settings.trimValues(true);
settings.excludeFields(excludeHeaders.split("ACCT,AGE"));
CsvParser baseFileParser = new CsvParser(settings);
String[] baseRow;
baseFileParser.beginParsing(baseFile);
while((baseRow = baseFileParser.parseNext())!= null){
System.out.println(Arrays.toString(baseRow));
}
我在想什麼。爲什麼輸出中缺少關閉報價?