Fetch file names based on last modified date using synapse pipeline

Nagesh CL 696 Reputation points
2022-12-06T16:21:31.71+00:00

Hi Team,

We have some .txt files in ADLS Gen2. The requirement is to process the files in the order it arrived (Based on the last modified time). PFB the screen shot.

267786-image.png

Could you please guide how to sort the files (using synapse pipeline activities) based on the lastmodifieddate ascending and pass the file name to subsequent pipeline / activity for processing.

Thanks.

Regards,
Nagesh CL

Azure Data Lake Storage
Azure Data Lake Storage
An Azure service that provides an enterprise-wide hyper-scale repository for big data analytic workloads and is integrated with Azure Blob Storage.
1,564 questions
Azure Synapse Analytics
Azure Synapse Analytics
An Azure analytics service that brings together data integration, enterprise data warehousing, and big data analytics. Previously known as Azure SQL Data Warehouse.
5,389 questions
Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
11,683 questions
0 comments No comments
{count} votes

Accepted answer
  1. ShaikMaheer-MSFT 38,551 Reputation points Microsoft Employee Moderator
    2022-12-07T10:24:07.747+00:00

    Hi @Nagesh CL ,

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

    One idea, which I am getting is, use Getmetadata activity to fetch all file names and then use ForEach activity to loop each file name. Inside Foreach activity, again use Getmetadata activity to get last modified date of file and then use script activity to insert that information into some SQL table.

    Once above completes, all file names along with last modified dates information will be available in SQL table.

    Now, you can execute a query on top of that SQL table to get rows in ascending order of last modified dates and then pass them to subsequent pipeline in same order.

    Please check below useful videos or resources that help you to get idea about various activities and scenarios which may involve in above implementations.

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


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


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.