I tried this and when the field is blank, the pipeline seems to treat it as
equivalent to zero, so this does work. Who'd have thought? I should have
more faith, I guess :-)
--
bc

On Thu, Jan 28, 2016 at 5:40 PM, Hobart Spitz <[email protected]> wrote:

> Have you considered something like:
>
> pipe < input.file | join x05 | specs a: f1 . b: substr 8-14 of f2 . 1-* 1
> print a+b 8-14 r | > output.file
>
> We combine the records pairwise as two fields, making them easier to
> process, and then we do what we want on the compound record.
>
> I hope this helps.
>
> On Thu, Jan 28, 2016 at 5:22 PM, Bob Cronin <[email protected]> wrote:
>
> > Hello specs fans,
> >
> > I have two records, like so:
> >
> > nnnnnnn
> > CCCCCCCmmmmmmmCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
> >
> > where nnnnnnn is a right justified integer and mmmmmmm is either that, or
> > blanks (which should be considered the equivalent of zero). C is an
> > arbitrary character.
> >
> > I want to emit the just the second record, with the mmmmmmm replaced with
> > the sum of nnnnnnn and mmmmmmm (or left alone if nnnnnnn is zero).
> >
> > I am trying to do this with specs, but am getting nowhere.
> > --
> > bc
> >
>
>
>
> --
> OREXXMan
>

Reply via email to