Here's a solution that doesn't assume the lengths of any of the fields:
/* Test to break up a line of input */
'Pipe (endchar ?)' ,
'< test input a' ,
'| a: Chop after string / /' ,
'| b: Juxtapose' ,
'| cons' ,
'?' ,
'a:' ,
'| Split' ,
'| b:'
On 11/10/13 1:24 AM, "Kris Buelens" <[email protected]> wrote:
> JUXTAPOSE is the typical answer for such a problem:
> 'PIPE (end ?) .....
> '|CH: CHOP 5',
> '|JX: Juxtapose',
> '|CONS',
> '?CH:|SPLIT|JX:'
>
>
> Kris Buelens,
> --- freelance z/VM consultant, Belgium ---
> -----------------------------------------------------------------------
>
>
> 2013/11/10 Mark Boonie <[email protected]>
>
>> I'm pretty sure I've seen the solution to this before, but, typically, I
>> can't remember it. I'd like to convert this:
>>
>> abc 123 45 6789 0
>> wxyz 98 333 44 8765
>>
>> to this:
>>
>> abc 123
>> abc 45
>> abc 6789
>> abc 0
>> wxyz 98
>> wxyz 333
>> wxyz 44
>> wxyz 8765
>>
>> The length of the "prefix" would/could be specified, so it wouldn't have to
>> be deduced in any way. Also, the non-prefix "words" in each line could be
>> assumed to be the same length:
>>
>> abc 123 45 6789 0
>> wxyz 98 333 44 8765
>>
>> Thanks for any suggestions.
>>
>> - mb
>>