I have a script which connects to database and gets all records which statisfy the query. These record results are files present on a server, so now I have a text file which
You can do it in your shell script itself.
You have all the files names in your spooled file output.txt, all you have to add at the end of existing script is:
output.txt
< output.txt du -h
It will give size of each file and also a total at the end.