You do not need to loop, something like this should make it:
grep -l "BPR" /your/path/PAYMENT/*
grep
is a tool to find lines matching a pattern in files.
-l
shows which files have that string.
"BPR"
is the string you are looking for.
/your/path/PAYMENT/*
means that it will grep
throughout all files in that dir.
In case you want to want to find within specific kind of files / inside directories, say so because the command would vary a little.
Update
Based on your new requests:
I need to go through all these files an find how many entries in each
file like BPR.
If its one I need to get an alert. For example, if xyx.txt contains
only one BPR entry, I need to get an alert.
grep -c
is your friend (more or less). So what you can do is:
if [ "$(grep -c a_certain_file)" -eq 1 ]; then
echo "mai dei mai dei"
fi