Both of those for loops are broken. They will fail to properly handle filenames with IFS characters (by default a space, tab, or newline), and will fail if the result of the filename expansion exceeds the system's command line length limit (when attempting to execute the ls).
The simplest, most efficient, and safest way to iterate over the filenames matching that pattern is:
for filehandle in salesreport*.txt
Simple demonstration:
$ touch 'with space1' 'with space2'
$ # Broken code
$ for f in $(ls w*); do echo "$f"; done
with
space1
with
space2
$ # Correct code
$ for f in w*; do echo "$f"; done
with space1
with space2
If someone is searching the forum for guidance on for loops, they might easily miss alister's excellent advice posted here because the title of the thread is How to run VI in batch mode, not about How to use loops. That's why it is best to start a new thread with an appropriate title for a new question. If necessary, you can include a reference to the old thread URL from the new thread.
Secondly, it is much easier to read code and data in threads when the text is surrounded by CODE tags. To do that almost effortlessly just select the text, and click the # symbol above the forum editing window. The result will be