Quantcast
Viewing all articles
Browse latest Browse all 24688

Help getting started with script component transform

I have a text file which has 2 columns, 1 is a record type and the other is a data string which I need to parse.  I am hoping to do this in a script component, but don't have much experience doing so.  IF somebody could just give me some sample code to get me started, I would appreciate that.  I have the task setup and have assigned the input and output columns to it, I just need help with the script.

Let say I have this file as an example

Record Type                Data

1                                ABDCEFGHIJKLMNOPQRS

2                                12345678901234567890

Let's say I have 2 output columns and they are column A and column B.  What I want to do is parse each data filed into 10 character output columns.

So for record type 1 my output would be column A = ABCDEFGHIJ and column B = KLMNOPQRS

For record type 2 my ouput would be column A = 1234567890 and column B = 1234567890

I am just looking for some help in assigning the values to the output columns and adding them to the buffer.  Any sample code or a link to some code would be greatly appreciated.

Thanks


Viewing all articles
Browse latest Browse all 24688

Trending Articles