cancel
Showing results for 
Search instead for 
Did you mean: 

Csv file with varying number of columns in each row

heidi_andrew
Contributor

my csv file has several rows for each person on the file. The specific rows have different number of columns in each row. CSV file reader is having trouble with it. Is this impossible to read for this snap?

1 ACCEPTED SOLUTION

koryknick
Employee
Employee

@heidi.andrew - here is another pipeline that provides a couple more examples how this could be done. In this pipeline, there are two examples - the first is similar to what @alchemiz has done, but with an added step to simplify the syntax of the record conversion into an array then object. The second path steps it down even farther using all basic snap functionality to split the input stream so it can be parsed separately based on the input row type.

I hope this helps!
Community 15513 - Multi-row CSV_2023_02_22.slp (24.3 KB)

View solution in original post

17 REPLIES 17

heidi_andrew
Contributor

heidi_andrew
Contributor

any luck with this little file?

alchemiz
Contributor III

Hi @heidi.andrew,

Good day, hope this helps… attached poc pipeline

canvas_01_2023_02_09.slp (11.6 KB)

image

Thanks,
MM

heidi_andrew
Contributor

This worked! I do not understand why or how. I have not used any of the json features yet but i will study it and learn how this works. Thank you so much.

Glad to be of help