11-04-2021 10:13 AM
Hi,
I am trying to read multiple zip files from S3 location using Directory browser-> S3 File reader → Decompress → csv Parser. Currently I have 2 zip files in the location which I could see till decompress preview. But csv parser is failing with below error. Does anyone know how to fix this and reason for the error? PFA for more info on settings and kindly help.
"Failure: Error parsing at record 5, content-location=s3:///bi-edw-dev/edw/inbound/services_demandplanner/zipdp/Upload1 210615-012.csv.zip, Reason: The number of CSV data fields is greater than the number of header columns in the input data: number of CSV data fields = 3, number of header columns = 1, Resolution: Please make sure the number of CSV data fields is not greater than the number of header columns."
Regards,
Amardeep Shanmugam.
11-04-2021 10:41 AM
Hey @amardeep2021,
You are receiving this error due to a lack of headers for the data, meaning you have more columns with data than the headers.
You can either unselect the “Contains headers” option, skip 1 line (the header line) and do the mapping of the headers in Snaplogic, or select “Trim record to fit header” policy. But beware, the second option will lead to a loss of data.
Regards,
Bojan
11-09-2021 06:03 AM
Thanks Bojan. It works.