使用
opencsv.
这就像读取CSV文件的魅力一样.
就记录损坏的行而言,您可以使用此逻辑来执行此操作.
while(input.hasNextLine())
{
try
{
//execute commands by reading them using input.nextLine()
}
catch (ex: UserDefinedException)
{
//catch/log the exceptions you're throwing
// log the corrupted line the continue to next iteration
}
}
希望这可以帮助.