Azure Data Factory adding header to csv files in Pipeline

AzeemK 516 Reputation points
2020-12-08T17:44:37.58+00:00

I am moving data in csv files from on prem file share to ADLS Gen 2 , I want to add header before data end up in ADLS as source .csv files doesn't have headers, I know what headers I want to add, I don't see any option in source and sink setting where I can add custom headers before data end up in ADLS container as .csv file. any pointer articles on this ??

Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
11,624 questions
0 comments No comments
{count} votes

Accepted answer
  1. MarkKromer-MSFT 5,226 Reputation points Microsoft Employee Moderator
    2020-12-08T21:09:30.417+00:00

    In ADF, create a new Data Flow. Add your CSV source with a no header dataset. Then add your Sink with a dataset that writes to ADLS G2 folder as a text delimited file WITH headers. In the Sink Mapping, you can name your columns:

    46372-image.png

    1 person found this answer helpful.

3 additional answers

Sort by: Most helpful
  1. Lucian Howard 6 Reputation points
    2022-06-08T11:31:24.72+00:00

    Hi,

    Please note in your dataflow sink (dataset) you need to add the first row has header. See below

    209446-firstrowheader.png

    1 person found this answer helpful.
    0 comments No comments

  2. Narendrakumar 1 Reputation point
    2022-05-11T19:47:41.567+00:00

    Can we use headers from a different file to map the column names?

    0 comments No comments

  3. Karthik Elavan 1 Reputation point
    2022-09-12T06:39:59.723+00:00

    Hi, My source is common data model with dataflow to sink the transformation, i want to store the csv file column as header and without delimiter format. in preview data, i can see the structure is header is column and row is data. how do we configure.

    0 comments No comments

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.