Repeat Target Path/ Header Name in a csv file

Hi,

My CSV has headers which repeat themselves - BLANK2 , BLANK2, BLANK2 , NAME, BLANK2

Mapper gives me error saying that I can’t have same Target Path names. I tried adding header fields to CSV formatter and Binary Header, that didn’t work. I tried adding .string() after the field name- didn’t work

I am thinking of a very convoluted way of doing this, but wondering if there is an easy fix that I am unaware of.

Please take a look at the CSV Parser documentation. There is a secondary input view that you can use to replace the column header names so that it will parse correctly.

1 Like

Thank you! I get the headers but it skips all the blank columns.

my headers are

name, id, blank, blank, school, blank, blank.

and I have the blanks in the data and schema, but once it comes out of parser, it gives me

name, id, school

and the blank is not there anymore.

Please provide a sample of your input file and desired output. We need to understand your requirements to assist any further.

Thanks so much!

I am attaching the file that I am uploading for headers, and the output we get, and the expected file. I have also attached two screenshots of the pipeline I have.

The data in there is dummy so it might not be consistent
ExpectedFile.xlsx (17.0 KB)
Header.xlsx (16.9 KB)
OutputIamGetting.xlsx (16.9 KB)


@cbot412 - So the root of the confusion here is that JSON does not allow two elements in the same object level to have the same name. Since you want to do exactly that, then you will need to generate a custom header record and prepend that to your content. Take a look at this post for ideas on how you could do it.

1 Like