Search code examples
azure-data-factory

How to Map the column with header csv file data in azure data factory


I am reading the csv files data to using azure data factory dataflow but the csv files does not have any headers so that its loading as below like that data in my source projection column.

enter image description here

I would like to map some of the column like as below set of position, I need to put decided column name in dataflow source projection column.

['_c0', '_c2', '_c8', '_c9', '_c10', '_c11', '_c12', '_c6']

_c0 -> customerName _c2 -> cusid ..... _c12->depid

I would like to add specfic column name needs to edit or rename dynamically. kindly assist, how do we implement.


Solution

  • I am showing you two ways of renaming the columns.

    First is,

    enter image description here

    This is my original dataset columns.

    Add Select transformation to your dataflow, and you will get option as below.

    enter image description here

    Here, add your required names in Name as field, as shown above. You will get result in data preview.

    enter image description here

    The other way is using Derived Column schema modifier and Select transformation.

    Add Derived Column to dataflow and you will get options as below. enter image description here

    Here, you can find Add option, click on that and add required column name in Column field and wanted column from source dataflow in Expression field as shown below.

    enter image description here

    After this add Select transformation and select the renamed derived columns as below.

    enter image description here

    Here is the result.

    enter image description here