Splitting the coulmn in a record
Moderators: chulett, rschirm, roy
Splitting the coulmn in a record
Hi,
I am having some data as follows:
Eg:( for one record)
5
3
4
5;5;6;7
8
9
10
My ouput should be as follows:
5
3
4
5
5
6
7
8
9
10
What is the best way of achieving this output?
I have started looking at data split stage from DS manual.. Is there any other way of doing this?
Appreciate your help
Thanks
Sue
I am having some data as follows:
Eg:( for one record)
5
3
4
5;5;6;7
8
9
10
My ouput should be as follows:
5
3
4
5
5
6
7
8
9
10
What is the best way of achieving this output?
I have started looking at data split stage from DS manual.. Is there any other way of doing this?
Appreciate your help
Thanks
Sue
Code: Select all
Convert(";",CHAR(10),YourField)
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Or, since you're on Windows, use Ereplace() to replace each";" with carriage return and line feed.
Code: Select all
Ereplace(InLink.TheString, ";", Char(13):Char(10), -1, 0)
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.
Hi,
The job flow is as follows:
Input ---> Transformer ---> File---> Table
In Transformer, Suppose if a column address needs to be divided into address1 and address2, the derivation for that column(address) is given as Ereplace(FromProgressICSP.addr, ";", Char(13):Char(10), -1).
Please help me how to populate address1 and address2 using the above derivation.
Thanks again for all the help!!
Sue
The job flow is as follows:
Input ---> Transformer ---> File---> Table
In Transformer, Suppose if a column address needs to be divided into address1 and address2, the derivation for that column(address) is given as Ereplace(FromProgressICSP.addr, ";", Char(13):Char(10), -1).
Please help me how to populate address1 and address2 using the above derivation.
Thanks again for all the help!!
Sue
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
That's a totally different question, and would be resolved with the Field() function - you are now after separate columns rather than separate rows. This question really deserved a new thread.paranoid wrote:Hi,
The job flow is as follows:
Input ---> Transformer ---> File---> Table
In Transformer, Suppose if a column address needs to be divided into address1 and address2, the derivation for that column(address) is given as Ereplace(FromProgressICSP.addr, ";", Char(13):Char(10), -1).
Please help me how to populate address1 and address2 using the above derivation.
Thanks again for all the help!!
Sue
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.
Hi,
I have data as follows:
Input record:
---------------
CompanyNumber:11
Name:XXXX
Address: 111 STREET NAME;P O BOX 1111
Code:0;0;41;0
City:XXXX
State:XXXX
I need to split the data to:
Output Record:
-----------------
CompanyNumber:11
Name:XXXX
Address1: 111 STREET NAME
Address2:P O BOX 1111
Code1:0
Code2:0
Code3:41
Code4:0
City:XXXX
State:XXX
Thanks
Sue
I have data as follows:
Input record:
---------------
CompanyNumber:11
Name:XXXX
Address: 111 STREET NAME;P O BOX 1111
Code:0;0;41;0
City:XXXX
State:XXXX
I need to split the data to:
Output Record:
-----------------
CompanyNumber:11
Name:XXXX
Address1: 111 STREET NAME
Address2:P O BOX 1111
Code1:0
Code2:0
Code3:41
Code4:0
City:XXXX
State:XXX
Thanks
Sue
As noted, a completely different question. Next time, new topic please. And as noted, the Field() function can be used to parse a delimited string into component pieces, and your address and code fields are ';' delimited strings. Check the online help.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
-
- Participant
- Posts: 11
- Joined: Mon Feb 25, 2008 5:53 am
- Location: Hyderabad