Java CSV file parsing does not parse empty columns at end

后端 未结 3 688
野趣味
野趣味 2020-12-17 00:20

I am parsing a CSV file, however there is one row were the last 9 columns are empty and the string split by comma ignores the remains empty columns.

Here is code to

3条回答
  •  离开以前
    2020-12-17 00:50

    Why are you doing manually job of actual CSV parsing library? There is no benefit to trying to skimp on proper job as there are a few good options out there.

    • SuperCSV
    • Jackson CSV module

    These would also handle aspects of CSV like doubled double-quotes, handling of extra white space and so forth.

提交回复
热议问题