Update/Transform Headerless CSV Source

Nestor Fregoso 0 Reputation points
2025-03-10T23:28:23.6066667+00:00

I am attempting to create a new dataflow to sink into a SQL table from a CSV source. My csv is missing it's header row though, so I'm stumbling on how to map the columns. It is delimited via pipe ('|').

Previous answers I have found reference a Headers 'Source Setting' that is not present in the current UI so those felt like dead ends.

Adding a DerivedColumn step after the source seems like the right call, but the examples I found use data with headers for their expression building and I wasn't able to figure out how to extrapolate that logic from there.

What are some guides or sources to achieve one of the following:

A) Insert a header row to the csv as part of the pipeline or data flow process?

B) Derive columns via the delimiter when the csv is missing the header row?

Azure Synapse Analytics
Azure Synapse Analytics
An Azure analytics service that brings together data integration, enterprise data warehousing, and big data analytics. Previously known as Azure SQL Data Warehouse.
5,233 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Q&A Assist
    2025-03-10T23:28:23.6333333+00:00
    AI generated content. This question contains an answer created with AI from Q&A Assist. Learn more

    To handle a headerless CSV source in Azure Data Factory, you can consider the following approaches:

    A) Insert a header row: While there isn't a direct method to add a header row during the pipeline execution, you can create a new dataset that includes the desired headers and then use a combination of transformations to map the data from your headerless CSV to this new dataset. You may need to use a derived column transformation to assign names to the columns based on their positions.

    B) Derive columns via the delimiter: You can use the derived column transformation to create new columns based on the delimiter. Since your CSV is delimited by a pipe ('|'), you can use string functions to split the data into separate columns. For example, you can use the split function in the derived column expression to extract values based on the pipe delimiter.

    For more detailed guidance, you can refer to the Azure Data Factory documentation on data flows and derived columns.


    References:


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.