Use Split function by using P as a split condition and use output in UBound to get total occurrence of “P” in a string.This UBound number will give count.
Example:
String1 = “This is the value of the string p and p is main split function”
strArrayValue = Split(String1, “P”)
TotalCount = UBound(strArrayValue)
MsgBox TotalCount
In that case, first you have to read all files from directory.
files [] = Directory.GetFiles("Folder Path")
And then use For Each loop to iterate one by one file and check below condition in IF activity. Before this loop, declare interger variable and say ‘count’ and initialize count with 0
ForEach item in files
IF Path.GetFileName(item).StartsWith("Q")
Then count = count + 1
Else nothing
If count > 0
Then file exists
Else file does not exist