lostjimmy hit the nail on the head. That is why I wrote my snippet in such a manner as to exclude any use of an external names file. My snippet below will read the directory instead of using a pre-written sorted file.
The Web is like a dominatrix. Everywhere I turn, I see little buttons ordering me to Submit. (Nytwind)
I've said in two places now that if the desired new names all follow from the example that your solution is preferable to one that uses the separate file. If the desired new names do not follow from the example, then you've changed the behavior by deviating from the spec.
Someone shouldn't have named a bunch of files with just digits to begin with. Just naming them "testfile1" through "testfilen" actually isn't much better for sake of description. One would hope there are no sequence holes in the new naming scheme at least, but without pbaumgar saying so we can't be sure.