Java- CSV / Delete column in csv file

2019-08-29 07:57发布

I try to delete a column in csv file in Java.

for example, I have this csv file

ID   name1   name2   name3
1    hello   hell    hel
2    try     tr      t
3    browser bro     br

and I want the after the next operation: (delete csvFile, 2) it will be:

ID   name1   name3
1    hello   hel
2    try     t
3    browser br

I found only operations that invlove rows and not column.

1条回答
祖国的老花朵
2楼-- · 2019-08-29 08:36

The only way to delete a column in a CSV file is to remove the header and the information of this column in the whole file, that is for each row of the file. Even if you use a third party library it will do this internally.

查看更多
登录 后发表回答