The CSV File Format For <file> Is Invalid. Line 2 Contains More Values Than The Header Line

Using Read CSV File activity returns the error "The CSV file format for is invalid. Line 2 contains more values than the header line."

Resolution

There are two possible approaches.

Approach #1

  1. Open CSV in Notepad or Notepad++.
  2. Check the delimiter being used.
  3. Pass the same delimiter in the Delimiter property of the "Read CSV" activity.

Approach #2

  1. Replace the "Read CSV" activity, with a "Read Text file" activity and use the .csv file as input and set a string variable for output.
  2. Use a "Generate Data Table" activity and use the String output from the "Read Text file" activity as input.

Refer to the UiPath Forum posts:
1 Like