I need to check if in a folder there are two files with the same name but with two different extensions (.xml and pdf).
How to perform this check?
In case there only one of the two I should move the file which hasn’t got the match.
Can you please help me in giving me a workflow?
Thank you,
Cami
With the following comment
— inside the loop use a if condition like this Outxmldilepath.Contains(path.GetFilenameWithoutExtension(item.ToString))
If the above condition passes it will go rot THEN part which means there is similar filenamed files
Which we can mention In a message box activity
If not will go to ELSE part where we can mention no similar named files in a message box
Here in the ELSE part we can use a move file activity with source file property as item and mentio the destination folder to the path where you want to move
What about it you want to match a files name to the folder and move but part of the file name will constantly change and the folders as well. For example if I have file is 1G23A and the folder is the same. The alphanumeric part will change. How can I incorporate it to an activity?
That will not work because I need to match a specific alphanumeric text within the file. It doesn’t matter about the extension. For example. I have a file named student_a1bcde_2019 and i have a folder with the following name Class123_student_a1bcde_2019. The a1bcde will always be changing because it is an id and unique to the user. I can match the pattern with regex but how do I match a file to the folder and move it if the condition is met. I have no clue and I am stuck
as per the @anandji05 way , it will filter the files with the given extension , and u can store the result in a array. Then u can iterate through each files and inisde it use move file activity to move the file