cancel
Showing results for 
Search instead for 
Did you mean: 

Getting error in csv parser when connected to Decompress snap

amardeep2021
New Contributor III

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."Screen Shot 2021-11-04 at 10.05.32 AM
Screen Shot 2021-11-04 at 10.06.00 AM
Screen Shot 2021-11-04 at 10.06.37 AM
Screen Shot 2021-11-04 at 10.07.17 AM

Regards,
Amardeep Shanmugam.

2 REPLIES 2

bojanvelevski
Valued Contributor

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

amardeep2021
New Contributor III

Thanks Bojan. It works.