in reply to rename files

Are you on a Unix platform? How about, first:
> perl -ne ' BEGIN { $i = 0 }; next if /^\s*$/; s/^/mv /; s/$/" testfile" . ++$i/e; print' filenames.txt > renames.sh

Then look through renames.sh and make sure you're happy with it. Then on the command line:
> sh renames.sh