Azure data factory Data Flow: How to delete rows if Specific text in row values

Techie 0 Reputation points
2023-06-12T03:19:35.9233333+00:00

Hi, I have a column in data flow that has Folder Path as Text as below:

FileSystem/Folder1/Folder2/Folder3/test.csv

FileSystem/Folder1/Folder2/Folder3/test01.csv

I want to delete rows that has 01.csv (want to keep only test.csv).

I tried using Alter row action but somehow I am unable to achieve what I want.

Can somebody help me do this? TIA

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

5 answers

Sort by: Most helpful
  1. SSingh-MSFT 16,461 Reputation points Moderator
    2023-06-12T06:06:25.11+00:00

    Hi
    Techie
    •,

    Welcome to Microsoft Q&A forum and thanks for using Azure Services.

    As I understand, you want to load specific rows to target using Data Flow and Azure Database for MySQL.

    Let us know if the ask is different from above.

    Considering the scenario described in the question, let's say we have a table in Azure Database for MySQL as "FilePathCheck" which has below data with columns as ID and Filepath:

    User's image

    Filepath stores value of Path of the file as mentioned in the question and we need to delete rows that has 01.csv (want to keep only test.csv).

    For this purpose, we can connect to Source, then use "Alter Row" transformation in Data Flow Activity as shown below with expression inside "Delete If" as like(Filepath,'%01%') :

    User's image

    User's image

    Like function with wildcard would delete rows having '01' and result would look like below in the Target Table 'FileCheckOutput':

    User's image

    Hope this helps.

    If this answers your query, do click Accept Answer and Mark Helpful for the same. And, if you have any further query do let us know.

    Thank you.


  2. ShaikMaheer-MSFT 38,556 Reputation points Microsoft Employee Moderator
    2023-06-14T05:38:04.0166667+00:00

    Hi Techie,

    Thank you for posting query in Microsoft Q&A Platform.

    After going through all your above comments, basically you don't want to see row which contains path at end as 01.csv in the unpivot transformation. For this you need to use Filter transformation not alter row transformation. In the filter transformation, use condition as like(FilePath, '%01.csv%') inside Filter on field.

    That way you will not see that row in Unpivot transformation.

    Please consider checking videos to understand more about these transformations.

    Filter Transformation in Mapping Data Flow in Azure Data Factory

    Alter Row Transformation in Mapping Data Flow in Azure Data Factory

    Hope this helps. Please let me know if any further queries.


    Please consider hitting Accept Answer button. Accepted answers help community as well.


  3. 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

  4. 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

  5. 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

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.