Haii All… I Had 2 folders … In Folder 1 I had some files in 2 I had some files… I need to match the files in folder 1&2 ,If files are matched means it will store in folder X else folder Y…
Can anyone help me? how to give condition to matched files that will store In X folder🙏
Get the files list from folder 1 . loop it and check whether it exists in folder 2. Based on the result, paste your file in x or y
Are asking if the file names match? If so, you could get the files from folder 1 and 2 using Directory.GetFiles() which is a .net line of code you can use in an Assign activity. Once you have both those arrays of files, then simply check if the filename is contained in the other array, which you can use some more .net for this.
Here is an example:
Assign activity: files1 = Directory.GetFiles(folder1, "*.pdf").ToArray
Assign activity: files2 = Directory.GetFiles(folder2, "*.pdf").ToArray
For each f1 In files1
IF activity, condition: files2.Any(Function(f2) Path.GetFilename(f1) = Path.GetFilename(f2) )
//Store f1 to folderX
Else
//Store f1 to folderY
or something like that.
Regards.
1 Like