i have the data like
Field1
aaaaaaa
bbbbbbb
cccccccc
ddddddd
eeeeeee.
Now i have to split this field1 to field 2 and filed 3
where filed2 should contain the 1st 3 chars and field3 should contain the last 4 chars. I can do this using a transformer. But i wish to use column import. Can i split the record using column import stage eventhough the input filed doesnt have a DELIMITER.
column import
Moderators: chulett, rschirm, roy
-
- Premium Member
- Posts: 236
- Joined: Sun Apr 01, 2007 7:41 am
- Location: Michigan
-
- Premium Member
- Posts: 301
- Joined: Thu Jul 14, 2005 10:27 am
- Location: Melbourne, Australia
- Contact:
Nope.
What's the attraction to the Column Import stage? Don't get me wrong, it's a great stage - It's got a pretty cool icon too! Do you subscribe to the 'transformers are expensive and to be avoided unless absolutely necessary' ethos? Many people do.
If you want to avoid a transformer you could try a Modify stage which would derive 2 new output columns using the substring function:
E.g.
(That's off the top of my head - no warranty implied!)
J.
What's the attraction to the Column Import stage? Don't get me wrong, it's a great stage - It's got a pretty cool icon too! Do you subscribe to the 'transformers are expensive and to be avoided unless absolutely necessary' ethos? Many people do.
If you want to avoid a transformer you could try a Modify stage which would derive 2 new output columns using the substring function:
Code: Select all
string = substring[start,length](string)
Code: Select all
field2:string = substring[1, 3](field1)
field3:string = substring[4, 4](field1)
J.
<b>John McKeever</b>
Data Migrators
<b><a href="https://www.mettleci.com">MettleCI</a> - DevOps for DataStage</b>
<a href="http://www.datamigrators.com/"><img src="https://www.datamigrators.com/assets/im ... l.png"></a>
Data Migrators
<b><a href="https://www.mettleci.com">MettleCI</a> - DevOps for DataStage</b>
<a href="http://www.datamigrators.com/"><img src="https://www.datamigrators.com/assets/im ... l.png"></a>
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
-
- Premium Member
- Posts: 236
- Joined: Sun Apr 01, 2007 7:41 am
- Location: Michigan
I can get this funtionality using transformer. But i want to know the functionality of column import. Will it split the data if the data doesnt have any delimiters. Just learning the functionlaity of column import stage.ray.wurlod wrote:![]()
Modify stage uses zero-based counting.
Nothing wrong with Transformer stages (these days) either.