Latest file extraction (Azure Data factory)

pankaj chaturvedi 86 Reputation points
2020-10-23T10:27:06.567+00:00

Hi Team,

I want to extract latest file from Azure data lake store based on last modified date and want to process in another folder.Could you please someone let me know what needs to be done here if anyone has idea or implemented the same.

for example i do have 3 files

"lastModified": "2020-10-22T08:21:53Z",
"fileName": "people.csv",

"lastModified": "2020-10-22T07:51:42Z",
"fileName": "Product.csv",

"lastModified": "2020-10-22T14:48:51Z",
"fileName": "Address.csv",

So it should process only "Address.csv" file.

I am looking forward your response.

Thanks,
Pankaj

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,341 questions
Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
9,542 questions
0 comments No comments
{count} votes

Accepted answer
  1. HimanshuSinha-msft 19,376 Reputation points Microsoft Employee
    2020-10-27T22:05:52.943+00:00

    Hello @pankaj chaturvedi
    Thanks for the ask and also using the Microsoft Q&A.

    We have created the below pipeline and our test shows that its should do the trick .

    Logic :
    1 . We will use 2 of the Getmetadata activity one for iterating the folder which have the files and the other to get the metadata for the specific file
    ( in this case the lastmodified date). The seond is a paramterized one and will pass the file name to that .

    2.We are using an if clause to check the the lastmodified date , I am using the tick function ( as it return an int , if you wish we can use anything else )

    @greater(ticks(activity('get file details').output.lastModified),ticks(formatDateTime(variables('TakeAnyStartDate'))))

    3.All the variables are self explanatory , but wanted to call out the TakeAnyStartDate , iam using this to set the any value to start with .
    I am using this as value "2000-10-27"

    Thanks Himanshu
    Please do consider to click on "Accept Answer" and "Up-vote" on the post that helps you, as it can be beneficial to other community members

    35581-l1.gif35420-l2.gif

    35524-l3.gif

    1 person found this answer helpful.

2 additional answers

Sort by: Most helpful
  1. ashok gupta 16 Reputation points
    2021-03-14T06:12:06.043+00:00

    I have explained this in a detailed video.
    please watch.
    https://youtu.be/9YU0RiGLijY

    2 people found this answer helpful.

  2. Vaibhav Chaudhari 38,576 Reputation points
    2020-10-23T13:25:43.99+00:00