Page 1 of 1

PARSE PROBLEM

PostPosted: Thu Jun 11, 2015 2:45 pm
by ottoelflaco
Hello!,

like always, sorry my english :(.

If I have some input data like this:
RATE STRUC ST DPE
PBE INSTNCDEDE
BILG  LM CAT CODE PRFDE
TEST ASEEEE AE
SSSSSSS A AAAA DDD
A B C D E R F C


I need the next:
For each record, I need to separate the information in function of the last blank previous at the column 11. For example, this would be my out:
RATE STRUC                   ST DPE
PBE                          INSTNCDEDE
BILG  LM                     CAT CODE PRFDE
TEST                         ASEEEE AE
SSSSSSS A                    AAAA DDD
A B C D E                    R F C


The separated information is colocated in column 30.

I m trying to use PARSE, but....not easy :? . could anybody help please?

Re: PARSE PROBLEM

PostPosted: Thu Jun 11, 2015 3:53 pm
by enrico-sorichetti
pretty impossible using sort...

easy using a program

parse in space separated tokens,
check the length of each token
concatenate tokens for a total length less than 11 for the first part
the rest of the tokens for the second part