How to check all excel file in one folder and use if condition to classification the excel file to new folder

Hi, I try to do a program that can check all excel file in a folder one by one and move file to folder, but for now i only can check one file. How can i do? please help me. :cold_sweat:

Below are the UiPath i doing.
Main.xaml (9.7 KB)

@horo1016
As far I do understand your flow, the following is done:

  • open excel and read in into datatable
  • check for a pattern if its matching
  • move the Excel related to isMatch result

to do it for multiple excels you can surround your flow with a for each and iterate over all files from folder.
the list of files from a folder you can retrieve with:

Directory.GetFiles("DirectoryPath")

used within an Assign activity and returning a String array with the filepaths

1 Like

@ppr i try to do what you say can please help me check did any part i did wrong?

Main.xaml (11.2 KB)

And what should i changefill in this part to locate all the file i check?

image

@ppr
i mean what should i fill in for the form part?

@horo1016
I cannot test as I dont have the excel. But let it run and do some post editing if required

Main_V2.xaml (12.1 KB)

Kindly note:
CheckNumber.All(function(x) System.Text.RegularExpressions.Regex.IsMatch(x.toString(),"^.{8}|^\d{2}110/E\d{3}-\d{2}"))

is doing this for all rows. So the surrounding for each row is not necessary and is avoidable

1 Like

Ohhh, i under stand now, the assign need to put inside the sequence. Thanks!! :smiley:

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