cancel
Showing results for 
Search instead for 
Did you mean: 

How to split Value in a field while importing

Former Member
0 Kudos

Hi,

I want to split Value in Field and map it 2 target Field.

Suppose Street field having values with House number and street name ,need to split at House Number and street name and map it 2 fields

EX : 1123 Dhuram Ave: Need to split 1123 and Dhuram Ave ,need to map it to 2 target field.

Here I don't have any delimeter in the field Value.

Please help on this.

Thanks,

Madhu

Edited by: Madhusudhan Honnappa on Nov 30, 2010 5:19 PM

Accepted Solutions (0)

Answers (2)

Answers (2)

rajesh_chavan
Active Participant
0 Kudos

Hi,

looks difficult if you don't have delimiter while splitting values during import.

Cheers,

Rc

Former Member
0 Kudos

Hello. I'm assuming this is a custom import as typically, standard extractors would have the house number and street already seperated into unique fields. Here is a quick routine I tried out that would split the field. Only thing I would add is that if writing this from scratch you would want to check that the first character is numeric and also that all characters before the space are numeric. This routine assumes that the field will be like xx yy where xx = house number and yy is the street. Mainly, it would assume anything before the first space is the house number and anything after is the street.


YLEN = STRLEN( YYINPUT ).
YTIMES = 0.
DO YLEN TIMES.
   IF YYINPUT+YTIMES(1) = SPACE.
      YOFFSET = YTIMES.
      "House Number" = YYINPUT(YOFFSET).
      YOFFSET = YTIMES + 1.
      "Street" = YYINPUT+YOFFSET.
      EXIT.
   ENDIF.
   YTIMES = YTIMES + 1.
ENDDO.

I'm sure there are many ways to go about this and may be some standard FMs you can call. I just like trying to write it first to get a better understanding. Not sure if this quick example will give you exactly what you need, but hopefully will at least give you a place to start.

Thanks