Select a .csv file based on file name

Prajwal MJ 21 Reputation points
2022-05-06T08:23:09.557+00:00

Hi,

There is a requirement that I need to select a specific file based on file name.

Suppose I am having files called: Sample1.csv, Sample2.csv, Sample3.csv, Sample4.csv, Sample5.csv

I need only Sample1.csv, Sample2.csv, Sample5.csv

So how to get based on file name as shown in the above example.

Thanks.

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

Accepted answer
  1. PRADEEPCHEEKATLA 90,641 Reputation points Moderator
    2022-05-09T07:55:50.023+00:00

    Hello @Prajwal MJ ,

    Thanks for the question and using MS Q&A platform.

    You can use list of files - fileListPath option to select the .csv files based on the file names.

    The file list path points to a text file in the same data store that includes a list of files you want to copy, one file per line, with the relative path to the path configured in the dataset.

    200201-image.png

    How to use this List of files option in File path type in copy activity?

    Step1: As per you requirement created five sample.csv files under a container called sampledata.

    200096-image.png

    Step2: As per your requirement create a file list path with the file which you want to call.

    200069-image.png

    Step3: Create a copy activity and under Source, you can select the File path type as List of files and select previous created file list path.

    200028-image.png

    Complete walkthrough on how to Select a .csv file based on file name as per your requirement.

    200191-adf-listfiles.gif

    For more details, refer to Azure Data Factory - File list examples.

    Hope this will help. Please let us know if any further queries.

    ------------------------------

    • Please don't forget to click on 130616-image.png or upvote 130671-image.png button whenever the information provided helps you. Original posters help the community find answers faster by identifying the correct answer. Here is how
    • Want a reminder to come back and check responses? Here is how to subscribe to a notification
    • If you are interested in joining the VM program and help shape the future of Q&A: Here is how you can be part of Q&A Volunteer Moderators
    2 people found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful

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.