currently I am working on files using power automate desktop, so I have the folder having 3000+ files(all pdfs) and out of it, I need to retrieve only 187 files (all pdfs) by filtering it by only the first 9 characters of the files (for ex: ABC-1234). the full file names is ABC-1234 v4.0.pdf.
This first nine characters will be unique for each file. How can I give the filter option in the get files in folder action. Or is there any options available to retrieve the files by partial names ?
Please suggest me. Your help is much needed.
I want to give it as in screenshot for 187 files in a single field. Looking forward for the solution.
On the file filter column, try putting the first 9 characters in between ** and that will retrieve file names with *ABC-1234*.
Hi,
Continuation of the previous discussion, I would like to copy only the files which has the pattern like ABC-1244-ddeee-fsdfsdf-fsdfsd.pdf into a another folder.
I tried giving the actions like below:
It says that file to copy not found in line 5. The "Match" contains the file name and so I thought it will copy to the folder I mentioned. Can you suggest the solution for this ?
Thanks
Great!!! 👍
Glad it worked.
Hi, I have tried something like this and it is working
Thank you for the solution!
You may be forced to use 'Parse text' so you can use regular expressions on the file names. That will not be fast, however. You could first use 'Get files in folder' for your list of files. Then loop through, parse for a regular expression to match your file pattern, then delete if it matches the regular expression.
However, if the letters and numbers are consistent as to number of letters/digits, hyphens, and spaces, you could try this (changing '.txt' to '.pdf', of course). The '*' in the version numbers ensures it will pick up things like "XZH-4239-v.27.292 QRZ [etc.]". You can of course experiment with different sequences of '?' and '*' until you can be virtually certain it will pick up all your use cases.
The problem is I don't have the same letter and number for each file. Each file has different letters and numbers, they are unique.
Here's a flow to get a list of files:
The 'Get files in folder' activity:
Now you have a List of all files matching the pattern. You can loop through the list and delete them.
Here are files in my folder:
Now, a message displaying the three that match:
These are in the variable List called %Files%. Just loop through the list and delete.
hi,
I need a help regarding the topic we discussed here. I need to delete the files which have the same pattern as
I tried this in PAD:
As you see in the screenshot, it is taking the file which has a same pattern but if I use delete that 'Match', it says that File to delete not found. How to delete only the files which have the pattern like
Thanks,
Radhika
Hi,
Even I also thought so, deleting the files in the source folder and replacing the new files in the folder structure will work. Thanks for your reply.
Hi @Anonymous, I don't believe that option is among the many that robocopy has. Please take a look at this guide by Adam The Automator to robocopy. I would suggest perhaps a) copying the new files to a folder as you presently do, perhaps with the /mov option or another combination of options; b) also copying them to a temp folder; c) deleting the files in the source folder; and d) copying the files in the temp folder back to the source folder.
Michael E. Gernaey
497
Super User 2025 Season 2
David_MA
436
Super User 2025 Season 2
Riyaz_riz11
244
Super User 2025 Season 2