How to count pages in a JOB_ or GRP_?

  1. XPP 9.2.2 on Windows Server 2012. We log in to WS 2012 using Remote Desktop.
  2. I have access to a cmd.exe window. I'm no expert at batch files though. I only know basic stuff.
  3. I have access to Powershell, which is already installed, but I have not used it before.
  4. I'm very familiar with Perl and text editors, so a Perl solution would be fine too.

Our JOBs are made up of many divisions, sometimes 20 divisions. In one case there are 45 divisions. We'd like an easy way to add up the pages for all divisions that begin with 2 numbers and a dash. The regex would be ^DIV_\d{2}\-. All other divisions are backups of divisions and are not part of the official book. So we do not want to count backup divisions in the page count.

Also, we are updating 24 JOBs for one customer. We'd like a way to add up the pages for all jobs in a GRP_ section, adding up only pages from divisions where the name starts with ^DIV_\d{2}\-.

Thank you!

Parents
  • Another route would be to use the closing root tag to output %totpage to a text file (e.g. totpage.txt) that is then looked for and the contents read by your batch file (I'd use Perl rather than batch file syntax. IMHO). You can easily create a JOB tool that trawls all the DIV folders looking for the target file ('totpage.txt'), opens, reads, adds to the accumulated total, closes etc. That wouldn't be too difficult to write using standard Perl and minimal XyPerl to write the data out.

    You're job tool could also make use of a Doc Assembly ticket if there was one, or using regex (as you described) to only scan target DIVs.

    You could also check - as you've described - by counting XPP's page files but that seems like harder work.
Reply
  • Another route would be to use the closing root tag to output %totpage to a text file (e.g. totpage.txt) that is then looked for and the contents read by your batch file (I'd use Perl rather than batch file syntax. IMHO). You can easily create a JOB tool that trawls all the DIV folders looking for the target file ('totpage.txt'), opens, reads, adds to the accumulated total, closes etc. That wouldn't be too difficult to write using standard Perl and minimal XyPerl to write the data out.

    You're job tool could also make use of a Doc Assembly ticket if there was one, or using regex (as you described) to only scan target DIVs.

    You could also check - as you've described - by counting XPP's page files but that seems like harder work.
Children
No Data