How to add Extra Column in CSV from another CSV using Data flow activity ?

Sudarshan Kumar 20 Reputation points
2024-02-11T09:12:35.66+00:00

HI , this is My CSV 1 and below is CSV 2

Input Is below two CSV

f_ID,f_Ctb
71431454,5678

CSV  2 

id,name,DownloadTextractOutput
1,sudarshan,Research Report:

The Output is below

f_ID,f_Ctb,Textarct
71431454,5678,Research Report:
Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
11,624 questions
{count} votes

3 answers

Sort by: Most helpful
  1. Richard Swinbank 527 Reputation points MVP
    2024-02-11T11:25:15.4733333+00:00

    If there will only ever be one row in CSV1, you can read it in and output it to a cache sink.

    You can include cached values in your CSV2 stream with a Derived Column transformation that uses a cached lookup expression, e.g. YourCacheSink#outputs()[1].f_ID


  2. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.


    Comments have been turned off. Learn more

  3. AnnuKumari-MSFT 34,556 Reputation points Microsoft Employee Moderator
    2024-02-12T10:52:19.3466667+00:00

    Hi Sudarshan Kumar ,

    Thankyou for using Microsoft Q&A platform and thanks for posting your query here.

    As per my understanding, you want to combine two csv datasets into single dataset by combining columns without having any common column between the two datasets. Please let me know if my understanding is incorrect.

    This can be achieved using mapping dataflow.

    1. Add two source transformations pointing to each of the input csv files.
    2. You can use 'Surrogate key transformation following each of the source transformations to create sequence number for each of the rows , say for first dataset, col1 having values as 1,2 and for second dataset , col2 having values 1, 2.
    3. Now , you have a common column between the two datasets.
    4. Use 'Join transformation ' to combine the datasets based on the common column values col1 and col2.
    5. Use 'Select transformation' to deselect the unnecessary columns.
    6. Use 'Sink transformation' to load the output to the sink file.

    Hope it helps. Kindly accept the answer by clicking on Accept answer button. Thankyou


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.