Skip to Content

Splitting the nodes based on the field length

Hi All,

I have a requirement wherein I have to generate the target record nodes based on the number of characters on the source field.

My source structure contains one field and the length of the field is 120.Target structure contains 3 fields the length of each field is 10.the first 30 characters of the source field must generate 1 record with 10 cahracters in each of the target field.And the next 30 caharacters must generate second record on the target side containing the same 3 fields and so on..So total 4 Records containing 3 fields in each record should be generated on the target side..

        Source         ----------->        Target

Record                                Record1(30)
      Field(120)    ------------->          Field1(10)
                                                 Field2(10)
                                                 Field3(10)
                                           Record2(30) 
                        ------------->          Field1(10)
                                                 Field2(10)
                                                 Field3(10)
                                           Record3(30)
                        ------------->          Field1(10)
                                                 Field2(10)
                                                 Field3(10)
                                           Record3(30)
                        ------------->          Field1(10)
                                                 Field2(10)
                                                 Field3(10)

Can any one help me getting this

Thanks in advance,

Vikram

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Nov 30, 2007 at 11:22 AM

    Hi,

    I guess using the function "<b>substring</b>" in mapping can solve your problem. Just give a try lik this.

    <b>For Record1</b>

    Source -


    > Substring (0.....10) -


    > Field1

    Source -


    > Substring (11...20) -


    > Field2

    Source -


    > Substring (21...30) -


    > Field3

    <b>Similarly for Record2, 3 & 4</b>.

    Source -


    > Substring (31...40) -


    > Field1

    *

    *

    *

    *

    and so on..

    Regards,

    Sarvesh

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Nov 30, 2007 at 11:20 AM

    in sender side

    RecordSet Structure=Record,*

    Record.fieldNames=field1

    Record.fieldFixedLength=120

    in Receiver side

    Recordset structure=Record1,Record2,Record3,Record4

    Record1.fieldnames=field1,field2,field3

    Record1.fieldFixedLength=10,10,10

    Record2.fieldnames=field1,field2,field3

    Record2.fieldFixedLength=10,10,10

    Record3.fieldnames=field1,field2,field3

    Record3.fieldFixedLength=10,10,10

    Record4.fieldnames=field1,field2,field3

    Record4.fieldFixedLength=10,10,10

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Nov 30, 2007 at 11:38 AM

    Thanks for the reply,

    But the 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)
                                                     Field2(10)
                                                     Field3(10)
    

            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)
    
    

    Hope you understood my question

    Thanks

    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.