I'm trying to solve the error `Too few fields: expected [10] fields but parsed [8].
Ultimately, the csv I'm looking at has indeed too few fields for certain rows. That is because usually when saving a csv, trailing empty values in are omitted in a given row.
Is there any way to add empty strings ("") to any trailing empty field to ensure each row has the same number of fields? We know how many fields are expected by passing a header.
I'm trying to solve the error
`Too few fields: expected [10] fields but parsed [8]
.Ultimately, the csv I'm looking at has indeed too few fields for certain rows. That is because usually when saving a csv, trailing empty values in are omitted in a given row.
Is there any way to add empty strings (
""
) to any trailing empty field to ensure each row has the same number of fields? We know how many fields are expected by passing a header.