Verify corrupted CSV

Hello once again,

I have been searching but i dont have a clear vision on this topic.

Is it possible to verify if a csv is corrupted before opening it?
For example:
Workbook book = new Workbook();
book.getWorksheets().get(0).getCells().importCSV(f, options, 0, 0);

badFile.zip (5.2 KB)

It opens the file and shows cell string values without problems, but i would like to catch corrupted files before opening.

Thank you

@hexxo,

Please note, a CSV file is a text file having contents/data or text in it. So, how could we know if it has different/irrelevant data or corrupt data because a corrupted text would be taken as plain data for text file type. In short, a file of text type may not be verified if it has corrupted data or irrelevant data in it.

1 Like

@Amjad_Sahi thank you for your insight, i did not know that.

Thank you!

@hexxo,

You are welcome.