Count of pages

tamhas

ProgressTalk.com Sponsor
Only by printing it to a file or processing everything twice. If you want to do N of M page numbering and the like, you need either a sufficiently sophisticated report writer tool or you need to do one of the above.
 

TomBascom

Curmudgeon
Or you can output a placeholder for the "of" portion and then use an external tool (such as "sed" under UNIX) to search and replace the placeholder with the final page count.

You might, for instance, output something like "Page 1 of _####_" and then, when the report is complete run a script like:

Code:
#!/bin/sh
#
# $1 = file name
# $2 = number of pages

mv ${1} /tmp/${1}
sed s/_####_/${2}/ < /tmp/${1} > ${1}
 
Top