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
  • Excellent answer from Bart, as usual.

    I've incorporated /showpages/ in a couple of tools here. One tool checks for "lost & found" pages only -- this is really useful for batch-composed PDFs (i.e. from a CCMS via XPPWS) that no one in our department ever reviews. When the tool detects L&F pages, we then run /showxsf/ to list the image names in those L&F pages, then the tool sends an email to the author who pushed the publish notifying them that there are possible issues with one or more pickups/images and their placement (or failure to place), and the images name(s).

    Edited for illustration purposes only--

    my $stderrfh = "/tmp/showpages.errs." . &Timestamp ;
    my $opts = '+p -fl -xsh -nol';
    my ($err,$core,@lfpages) = TLC::Xpp::Showpages($dpath, $stderrfh, $opts);
    my @lflines = grep /(Frst|Last) p/, @lfpages;
    scalar @lflines && do {
    my $stderrfh = "/tmp/showxsf.errs." . &Timestamp ;
    my $opts = '-laf -nol';
    my ($err,$core,@lfsxf) = TLC::Xpp::Showxsf($dpath, $stderrfh, $opts);
    @lfgrafs = grep /\/GRAPH/, @lfxsf;
    @lftech = grep /(dldid=|\d: )/, @lfxsf;
    };

    Note: the package TLC::Xpp is, I believe, a professional services-supplied package. Substitute whatever tried-and-true Perl XPP subroutines you may have on hand, or simply a well-formed system call with appropriate error checking.
Reply
  • Excellent answer from Bart, as usual.

    I've incorporated /showpages/ in a couple of tools here. One tool checks for "lost & found" pages only -- this is really useful for batch-composed PDFs (i.e. from a CCMS via XPPWS) that no one in our department ever reviews. When the tool detects L&F pages, we then run /showxsf/ to list the image names in those L&F pages, then the tool sends an email to the author who pushed the publish notifying them that there are possible issues with one or more pickups/images and their placement (or failure to place), and the images name(s).

    Edited for illustration purposes only--

    my $stderrfh = "/tmp/showpages.errs." . &Timestamp ;
    my $opts = '+p -fl -xsh -nol';
    my ($err,$core,@lfpages) = TLC::Xpp::Showpages($dpath, $stderrfh, $opts);
    my @lflines = grep /(Frst|Last) p/, @lfpages;
    scalar @lflines && do {
    my $stderrfh = "/tmp/showxsf.errs." . &Timestamp ;
    my $opts = '-laf -nol';
    my ($err,$core,@lfsxf) = TLC::Xpp::Showxsf($dpath, $stderrfh, $opts);
    @lfgrafs = grep /\/GRAPH/, @lfxsf;
    @lftech = grep /(dldid=|\d: )/, @lfxsf;
    };

    Note: the package TLC::Xpp is, I believe, a professional services-supplied package. Substitute whatever tried-and-true Perl XPP subroutines you may have on hand, or simply a well-formed system call with appropriate error checking.
Children
No Data