cancel
Showing results for 
Search instead for 
Did you mean: 

How to Parse Characters?

Former Member
0 Kudos

Hi Folks,

Can anyone help me out on how to parse the characters in data services. Here is the example:

Rule: Parse first three characters MU_1000008 to 1000008

What is the function I can use?

Any help is appreciated.

Thank you

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

1. If you just want to take all characters starting from the 4th character till the end, you can use:

substr(input_col,4,length(input_col)-3)

2. If you always want to read the characters following the first underscore, use:

word_ext(input_col,-1,'_')

3. If your input always start with 'MU_', then use:

replace_Substr(input_Col,'MU_','')

or

ltrim(input_col,'MU_')

Regards,

Shine

Edited by: Shine SS on Jan 28, 2012 10:52 AM

0 Kudos

HI, Shine SS

you explain very with examples..pls help me out on how to create new field to take first character from first name and first two character from last name.

example:-

Emp Name          New Field_ Short Name

John Smith          JOSM

Warm Regards

Varsha

former_member187605
Active Contributor
0 Kudos

substr(word("Emp Name",1),1,2)||substr(word("Emp Name",2),1,2)

0 Kudos

Perfectly work..Thanks a lot..Dirk Venken

0 Kudos

It has been answered but not able to close thread.

0 Kudos

Hi,Dear All,

I am Trying to go from

Id

LS001

LS003

NT006

LS007

ES009

LS004

TO  OUTPUT


Col          ID

T1          LS001,ES009,LS003

T2          NT006

T3          LS007,LS004

pls help me out or give me  hint or idea so i can use that.

Regards

Varsha

Answers (1)

Answers (1)

PedroFernandes
Explorer
0 Kudos

Hi,

Look in the Data Services Reference Guide for functions 'lpad', 'lpad_ext' and 'ltrim' syntax.

One of these should help you trim your data. You can use the function inside a mapping, in a query transform.

Hope it helps,

Pedro