On Fri, 23 Aug 2019 at 02:20, John Imholte <[email protected]> wrote:

> I know that I have seen this on the list but don't remember and can't find
> it, so I finally give up and come the the list.
>
> I have a file that I would like to add sequence to the left of the record.
> It would also be nice if I might edit the sequence number to a length of
> the record count +1 zero suppressed.


The classic way to add record numbers is like this (and there are options
to change the start and increment)

 ..  | spec number 1.10 r 1-* nw | ..

That's without leading 0's. If you'd want those, you can use PAD 0 to have
that. And you can use a different width of the field.

Do you mean you want to limit the width of the numbers to what you need for
the last one? That means you'd have to buffer the entire stream to find out
how many you have, and use that to determine the width. Or you can use that
information to remove the first few bytes once you know it's too much.

Sir Rob the Plumber

Reply via email to