troubleshooting Question

Unable to read CSV file with this Java Code

Avatar of Ted Penner
Ted PennerFlag for United States of America asked on
Microsoft OfficeProgrammingJavaMiscellaneousMicrosoft Excel
12 Comments1 Solution21 ViewsLast Modified:
We are trying to read this CSV file line by line using the below code but a row in the CSV file seems to stop the execution of the program in the middle. If we delete that row manually the program is able to read all the rows till the end.

Read is successful until ID 32267. After that, the program appears to be stopped. If we delete the next row ID 32268, manually from the CSV file, then the program is able to read the complete file without any error.

Java Code -

CSVReader reader = new CSVReader(new FileReader(fileName));
String[] row;

while ((row = reader.readNext()) != null) {
                System.out.println(Arrays.toString(row));
}
reader.close();
Data - Copy.zip
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 12 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 12 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros