Get 5 files only in a folder

Hi All,

As I got 10k files in a folder and it’s quite difficult to get all of them at once. therefore are there any methods so that I can get 5 files each time and do the handling, after that, get another 5?

Directory.Getfiles(file_path).take(5), are there somethings like this?


Hello @raymondhui,

You can create a loop then max number is Directory.GetFiles(File_Path).Count(), use Skip and Take methods.
For Instance : Directory.GetFiles(File_Path).Skip(Counter).Take(5)
You can increase counter every loop and start value’ll be 0.

If you’d like to workflow, I could share with you.


1 Like

Fixed, I changed the datatype to array(ienumeble) type and fixed. Many thanks.

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