Combine columns from multiples csv files in azure data factory

Obaid Ur Rehman 86 Reputation points
2022-03-15T23:42:12.487+00:00

First of, I know there are similar solutions exists but this problem is somewhat different.

I have a process that produces multiple csv files based on user input 'n' (Where n > 1 and n <100). Means user can generate any number of files.

These files have same columns:

file1 -> Col1 Col2 Col3 Col4 Col5 output
file2 -> Col1 Col2 Col3 Col4 Col5 output
file3 -> Col1 Col2 Col3 Col4 Col5 output

These files are stored in azure blob with some datapath.

I want to read all the files and produce a result file like this:

Col1 Col2 Col3 Col4 Col5 output1 output2 output3

Is there any way of doing this dynamically. I.e without creating multiple sources in data flow and joining them because the files generated depends on the user and I cannot hardcode it.

Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
{count} votes

Answer accepted by question author
  1. Nasreen Akter 10,891 Reputation points Volunteer Moderator
    2022-03-16T01:26:39.597+00:00

    Hi @Obaid Ur Rehman ,

    Thank you for the ask.

    You can try the following:

    • add filePath as a column
    • rank the data based on filePath
    • pivot the data

    Please see the screenshots for details. Hope this helps, thanks!

    183522-image.png
    183512-image.png
    183534-image.png
    183494-image.png
    183535-image.png
    183495-image.png
    183536-image.png
    183455-image.png

    2 people found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

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