I was getting an error while reading the csv file can anyone help me the error is

Read CSV: The CSV file format for C:\Users\dhana_000\Desktop\HR_changes.csv is invalid. Line 2 contains more values than the header line.

Your CSV has more data than it has headers.

For instance if my CSV looks like this:

Title,Author,Comments
The Old Man and the Sea,Ernest Hemingway,Sold,but more incoming
The Green Mile,Stephen King,Available

This is an invalid file, because the header has 2 commas, but the second line has 3. Be sure to check your CSV for cases like this.

2 Likes

@Anthony_Humphries yes thank you

I am facing the same issue, is anybody having solution for the same. I did the workaround by adding semicolon at the end of column header in csv file.

As this is temporary solution, how to fix it without doing manual work.

1 Like

Always remember to check for the separator charachter used in reading the csv

Please send me your solution for adding semicolon at the end of column header in the csv file?