On 04/22/2015 09:08 PM, Gentry, Steve wrote:
I've found that SPEC has a PAD option/function.
Correct.
From what I've read it is used to pad a field with a leading character.
Not quite. It is the character inserted between fields, and also the one used to pad out an output field that is larger than the actual input source.
I have a word, in a stream, that can be up to 8 characters long, however, if it isn't 8 characters, I'd like to append a dot/period to complete the 8 characters. I can use the PAD stage and in the grand scheme of things the time is insignificant.
You can do that with pad, but you might have to turn it off again: ... | spec pad . 1.3 7.5 | ... Will get you lots more dots than you want. Here the idiom is ... | spec // 7 pad . 1.3 7.5 | ... This pads out with blanks to column 7. Then you can get the pad you want and then you can turn it off again to write another field somewhere else. Rather fiddly: ... | spec // 7 pad . 1.3 7.5 centre pad blank 4.3 10.5 centre| ...
However, I was wondering if the PAD function in the SPEC stage can do such a thing.
SPEC can do anything. You only have to find out how :-)
Thanks, Steve
