I want to move files from DLV030,E-INV,PL to another folder (other folders don’t move). Please help me. Thank you
Directory.GetFiles(“D:\RPA\UiPath\IPS\Get DFR\Input",”.",SearchOption.AllDirectories).Where(function(s) NOT s.Contains(“xxx”))
can you please explain if you are facing difficulty in anything
also you can directly use for each file in folder activity
- Create a list of paths and initialize it with the paths to each source folder (DLV03, E-INV and PL)
- Do a for each loop on this list
– (For each path) use the activity “For Each File in Folder” by passing the path to the property “In folder”
– If needed, use the “Filter by” property in the same Activity to select only the files you want to move
— (For each file) use the activity “Move File”
It will be a loop within a loop.
I can directly use for each file in folder activity. But I want to ask can we use 1 for each to move (file in 3folder: DLV030,E-INV,PL) ?
2 options here
if you are deciding which file to move to which folder depending on any criteria then use one loop and if conditions inside to check criteria and change destination folder
or use 3 for loops without any conditions
Ah, you mean something like this?
Directory.GetFiles("your_root_folder", "*", SearchOption.AllDirectories).Where(Function (f) f.Contains("\DLV03\") OrElse f.Contains("\E-INV\") OrElse f.Contains("\PL\")).ToList
Then you do just one loop with the list you get from this operation.
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.