Merge two .csv files

  • Hi,

    I have to merge two .csv files into ont single file, using these simple rules:

    1 - replace field 1 and field 2 in file1 from file2 where keys are equal.

    2 - take rows from file2 where key doesn't exist in file1.

    Rule 1 I have been able to satisfy by using a Merge Join task.

    My question is which task should I use for rule 2? Which task will identify rows in file2 that are not found in file1?

    Thanks,

    LenFeld

  • Assuming that you are dumping the csv file to a temp table, you can use Execute SQL outside the DataFlow task and use the NOT EXISTS query to return the required resultset.

    --Ramesh


  • Thank Ramish, for your reply.

    I was trying to avoid using a database since my business requirements was simply to read two .csv's and merge into one.

    But I am resigned to the fact that I will have to import both into two tables and do the data manipulation in SQL.

    Thanks again,

    LenFeld

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply