Hi
String.Join(“”, Directory.GetFiles(PastaDownloadDocumentos,“*.pdf”,SearchOption.AllDirectories).OrderByDescending(Function(d) New FileInfo(d).lastwritetime.date = today))
This is what o mean?
Hi
String.Join(“”, Directory.GetFiles(PastaDownloadDocumentos,“*.pdf”,SearchOption.AllDirectories).OrderByDescending(Function(d) New FileInfo(d).lastwritetime.date = today))
This is what o mean?
I think, so it will work. can you check screenshot ?
If I can’t find another way I’ll try it again bro. Because I prever not working with loops
You don’t want to use loops in your Activity.
Loops are works better in my opinion.
I’m using:
String.Join(“”, Directory.GetFiles(PastaDownloadDocumentos,“*.pdf”,SearchOption.AllDirectories).OrderByDescending(Function(d) New FileInfo(d).LastWriteTime).Take(1))
With this expression, the robot is processing the last pdf in folder, in terms of arrival.
And I want to process the oldest one.
You can do it in one line query without looping…I will show you when I get back…
String.Join(“”, Directory.GetFiles(PastaDownloadDocumentos,“*.pdf”,SearchOption.AllDirectories).OrderByAscending(Function(d) New FileInfo(d).LastWriteTime).Take(1))
Try this expression
Hi,
That is the challenge as I said earlier with Creation and LastWriteLine when files are downloaded. What if you use Ascending? Do you get the expected, I am assuming it should because that will be the least distant time (last modified closest to Now).
You right! I didn’t saw that coming. Maybe is better to work with loops
@Andre_Vieira - Please check here…
My Files
OrderByDescending Using LastWriteTime - File3 sorted first
.First will read the first file…
If you want to read the first created file…then try this…
Is this what you are looking for??
I have to test it here first
Can you please copy the expression and pass it to us please? I don’t want to miss any char.
Another question, what is your variable type?
@Andre_Vieira - Please test it…
Directory.GetFiles("YourFolderName").OrderByDescending(function(x) new fileinfo(x).LastAccessTime).First
You have to assign it to StringVariable since we are using .First…it is not a array…You can see from the screenshot…
@Andre_Vieira - Note: I haven’t used any file types here and did not search with in subfolders…
If you have those requirements, then you just have to use…
Directory.GetFiles("YourFolderName","FileSearchPattern",SearchOption.AllDirectories).OrderByDescending(function(x) new fileinfo(x).LastAccessTime).First
Hi !!
Assuming that I want to get first the oldest file in the folder.
Using your example should be the file dated from 12:19
@Andre_Vieira - Please read my post again…i have provided solution for both …See the third one here…
Reason why the post is dragging is You have to pay attention and understand what we are showing and telling…if not issue will never get solved…
Thank you, that expression is doing exactly what I want it Great work!!!
Regarding this post is dragging I can assume that you are not paying much attention as well my friend. Because I explained very well 2 or 3 times in this post what I really needed and you came up with 2 or 3 solutions at the same time including 2 that do the opposite.
Sending screenshots from the expression can lead to multiple miss understandings.
You did a great job today no doubt.
Thank you
Friend…The reason why I gave multiple solution is, I see lot of times people changes the requirement or they will come back and ask what if i want this? that??? that’s wherever possible sometimes I show them couple of options…It won’t hurt right??
There is a reason for this too…By this way you can type and see how to code and you will get a great feel when you finish typing and there is no error…This way your learning will be faster…
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.