Hi,
I need some advice on following data extract.
In the source there is a field with following data format
A12-ABCDEFG123456 ^ 12345678
Now I want only the part ABCDEFG123456
I have tried Field(Mystring, "-", 1) which will give me result = A12 if I use Field(Mystring, "-", 2) it will give me result = ABCDEFG123456 ^ 12345678
Please advice me how to get only ABCDEFG123456
Thanks.
Tlam
Data extract from source
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
For something that simple, you could nest the Field functions.
The MatchField() function can also be used here.
Code: Select all
Field(Field(InLink.MyString, "-", 2, 1), "^", 1, 1)
Code: Select all
MatchField(InLink.MyString, "0X'^'0X'-',0X",3)
Last edited by ray.wurlod on Wed Feb 06, 2008 7:47 pm, edited 1 time in total.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
[quote="ray.wurlod"]For something that simple, you could nest the Field functions.
As Ray suggested nested field functions is good .
Ray's function is resulting 12345678
Probably below is the one you are looking ,which results ABCDEFG123456
Field(Field(InLink.MyString, "^", 1, 1), "-", 2, 1)
Code: Select all
Field(Field(InLink.MyString, "^", 2, 1), "-", 1, 1)
Ray's function is resulting 12345678
Probably below is the one you are looking ,which results ABCDEFG123456
Field(Field(InLink.MyString, "^", 1, 1), "-", 2, 1)
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact: