Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to break a field into rows?

Status
Not open for further replies.

BuzzOne

Programmer
Sep 26, 2002
8
US
Hi all,

I have a field say Field1, having data 'ABC1ABC2XYZ RST3' in the input Text file. I need to put this data as,
Field2
ABC1
ABC2
XYZ
RST3
in the target table. i.e I need to break the data into parts of constant length 4, and put that as rows.
How can we do this in Informatica?
 
I think I got it..Maybe the Normalizer tranformation should do the job. Is that right ?
 
Hello Buzz,

Provided you have a string of limited length , say 16 characters, you can split the flow in a mapping to 4 subflows. Define 4 expression transformations with outgoing ports defined like:

Substr(field1,1,4)
Substr(field1,5,4)
........
........

Then end each flow with the same target table. (Do not set the field2 in the target as a primary key, if you want duplicates for values of field2 in the target).
Run an insert session, and you should get correct input in field2 with 4 times the number of records.
T. Blom
Information analist
Shimano Europe
tbl@shimano-eu.com
 
Buzz

I think you were there with the Normalizer idea. Use an expression to create the four substrings, pass them into a normaliser and then select the required substring on each output from the normaliser.

Mark
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top