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
  • Chuck,

    If you really want to make your life easier, have a look at the 'showpages' utility.
    (do a 'xyhelp showpages' to see all the options...)

    You might run the following command at the job level:
    "showpages -t -job -all"
    this will gives you a total by division AND a grand total of all pages in all divisions

    "showpages -t -job"
    will use the DA ticket to see what divisions are active, so it will only count those

    and you can also do this:
    "showpages -t -job -div div1,div2,..."
    to get the count of only certain divisions.
    (sorry but you can not use a regex in the division name, see below for that)

    So if you are fluent in perl, you should have no trouble running a listing of the job folder, filter out the divisions you want, remove the "DIV_" part of the division name, put all of that in a string (lets say: $divs" and finally run a system command that more or less looks like:
    "showpages -t -job -div $divs"
    and then grep the last line of the output.

    Once you have that routine worked out, it should not be big deal to repeat the job level count routine on all jobs that live under a particular group or even class.

    Good luck
Reply
  • Chuck,

    If you really want to make your life easier, have a look at the 'showpages' utility.
    (do a 'xyhelp showpages' to see all the options...)

    You might run the following command at the job level:
    "showpages -t -job -all"
    this will gives you a total by division AND a grand total of all pages in all divisions

    "showpages -t -job"
    will use the DA ticket to see what divisions are active, so it will only count those

    and you can also do this:
    "showpages -t -job -div div1,div2,..."
    to get the count of only certain divisions.
    (sorry but you can not use a regex in the division name, see below for that)

    So if you are fluent in perl, you should have no trouble running a listing of the job folder, filter out the divisions you want, remove the "DIV_" part of the division name, put all of that in a string (lets say: $divs" and finally run a system command that more or less looks like:
    "showpages -t -job -div $divs"
    and then grep the last line of the output.

    Once you have that routine worked out, it should not be big deal to repeat the job level count routine on all jobs that live under a particular group or even class.

    Good luck
Children
No Data