You could do something like
for f in QP????.txt; do echo $f | cat - $f >$f.withname; done
to create new files QP1172.txt.withname
etc., and then replace the old ones with them after checking that everything looks ok.
(cat
here concatenates the name (given on standard input) with the file contents of each file.)
ADDED: To make it easier to let the new versions get the right name afterwards it might be easier to let them have the same name, but in another directory.
mkdir withname
for f in QP????.txt; do echo $f | cat - $f >withname/$f; done