I have a table that I am using in a package to create an extract from. In that table is an address field called "Street" that is 255 characters in length. My table also has 3 additional fields called address_1, address_2 and address_3 that are each 50 characters in length because that is the requirement for my extract. I need to split the address field up in such a way that if it is longer than 50 characters, it backs up to the first space in the address prior to character #50, puts that info in street1, then from that cut off point used in street1, puts the next 50 up to the prior blank space in street2, then the remainder in street3. Where the extract will be used only has three 50 character fields so if the data runs more than 150 characters, the street3 data will just have to be truncated. No way around that, but I don't anticipate any address getting close to that long.
Although doing such a split would be much easier using SQL, the solution requirement is that it
be done in the package, not using SQL to do so.
I'm assuming I need to use a "derived column transformation" in my data flow. But, I can't figure out how to do what I need to do with a derived column transformation.
Example of info in an address:
123 Chicamauga Avenue South, Across the Street from International Center Square, Apartment Number 17650 Tokiwa-machi Machida
position 1-50:
123 Chicamauga Avenue South, Across the Street fro
Therefore, Street1 would need to get:
123 Chicamauga Avenue South, Across the Street
Street2 would need to get:
from International Center Square, Apartment Number
Street3 would need to get:
17650 Tokiwa-machi Machida
If you do it with simple substrings:
Street1 would actually get:
123 Chicamauga Avenue South, Across the Street
Street2 would actually get:
International Center Square, Apartment Number (which would leave out the word "from" in the original address)
Street3 would actually get:
17650 Tokiwa-machi Machida
Any help would be greatly appreciated.