I have a list of files and I need PAD to look at this list and give me the list item that matches a wildcard ("SGC").
Is there a way to do this?
I tried "Remove item from list" with the Value of anything that doesn't end in "SGC" but it didn't like the syntax.
From experimenting, I've been able to parse a list with a regex wildcard but instead of giving me the list item where it found the "SGC" match, it simply stored the matched text.
Suggestions appreciated 🙂
Hi @MTIncPower
Try this:
1) 'Get files in folder' to get the list of files (%Files% as output variable)
2) 'For each' CurrentItem in Files
3) 'If' %CurrentItem% (First operand) Does Not Contain (operator) 'SGC' (Second operand) then
4) 'Remove item from list' > Remove item by Value, With value = %CurrentItem%, From list = %Files%
5) 'End' (If's end)
6) 'End' (For each's end)
At the end, %Files% will have only items with 'SGC'.
Yasunm is right - I'll just add a screenshot for your convenience:
Hi @MTIncPower ,
You can Try in this way
Try this:
Get files in folder' to get the list of files (%Files1% as output variable)
For each CurrentItem in %Files1%
If' %CurrentItem% (First operand) Does Not Contain (operator) 'SGC' (Second operand) then
Remove item from list' > Remove item by Value, With value = %CurrentItem%, From list = %Files1%
End (If's end)
End (For each's end)
At the end, %Files1% will have only items with 'SGC'.
If it works Please mark as a solution, so it will help even others also.
Regards
Ahammad Riyaz
Are all the files in one folder to begin with? The "Get files in folder" command has a file filter.
File filter *SGC should only pull in those files. This says, it must end in SGC to be pulled in to the list.
Update: Adjain is correct...unless the file ends in .SGC, you will need the * after.
Hi @MTIncPower You can use this directly
Note the two * before and after SGC in the file filter parameter. (*SGC*)