Read text file1

Hi all, I have a doubt.

I have a folder by name processed, in that folder I have download, download1 and download2 files. From here I want to read the last saved file.
Sometimes I may have 3 files or 2files or only 1file.
How can I do read that particular file.

Please help me.
Thanks in advance

Hi @hanviprebday

You can use this an assign activity:

Directory.GetFiles(folderPath,“*.txt”).OrderByDescending(Function(d) New FileInfo(d).CreationTime).Tolist(0)

Here .txt could be replaced with download.extension. whichever extension the file is.

Happy Automation! :smiley:

Thank you it worked

Hello @hanviprebday

Please close the topic by marking as solution.

Thanks
Happy Automation to you! :smiley:

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.