I'm afraid I don't quite understand what your intention is here ... sounds like you're just trying to count the number of regular files under a given directory path,
So what's the problem?
This is how I counted all files under my /tmp/*
$ find /tmp -type f | wc -l
Here's what the first several file paths look like
$ find /tmp -type f |