Skip to Content

UDF for Splitting the nodes based on the field length

HI All,

Target records Record1 to Record4 must be created based on the length of the source field length i.e, if the source field length is only 90 then only 3 records must be created.maximum length of the source field is 120.The source and the target structure are as shown

Source                                  Target
 Record                                Record(30)
      Field(120)    ------------->          Field1(10)

After mapping:-

        Source         ----------->        Target
Record                                Record1(0 to30)
      Field(120)    ------------->          Field1(0 to 10)
                                                 Field2(10 to 20)
                                                 Field3(20 to 30)
                                           Record2(30 to 60) 
                        ------------->          Field1(30 to 40)
                                                 Field2(40 to 50)
                                                 Field3(50 to 60)
                                           Record3(60 to 90)
                        ------------->          Field1(60 to 70)
                                                 Field2(70 to 80)
                                                 Field3( 80 to 90)
                                           Record3(90 to 120)
                        ------------->          Field1(90 to 100)
                                                 Field2(100 to 110)
                                                 Field3(110 to 120)

Can any one provide me the code to get this done.

Thanks ,


Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Posted on Nov 30, 2007 at 01:37 PM

    You need no UDF. You can use the substring function, but you should check the length of the string to prevent mapping errors due to the substring function.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.