Hitachi Vantara Pentaho Community Forums
Results 1 to 4 of 4

Thread: Split Fields: Need only some fragments

  1. #1

    Default Split Fields: Need only some fragments

    I have a field that has a common delimiter and contains a number of fragments like abc-123-4-5-6-789-ABC-DEFGHIJ.

    I need to parse out only the 5th and 6th fragments and assign them to two fields. How can I do this? Is Split Fields the right tool for this? To me it looked as though you have to assign all fragments to new fields using Split Fields.

    Even if I use Split Fields and just ignore the extra fields, the original field is not included in the input field list anymore. I still need the original field to be in the list as well.

    Gerry
    Last edited by greno; 10-08-2007 at 01:02 PM.

  2. #2

    Default

    Ok, I used some javascript to create a copy of the original field and then I pass the copied field into Split Fields but it is not working. I see this exception:

    2007/10/08 13:11:38 - Split Fields.0 - ERROR (version 3.0.0-RC1, build 299003 from 2007/10/01 23:14:52) : Unexpected error :
    2007/10/08 13:11:38 - Split Fields.0 - ERROR (version 3.0.0-RC1, build 299003 from 2007/10/01 23:14:52) : java.lang.ArrayIndexOutOfBoundsException
    2007/10/08 13:11:38 - Split Fields.0 - ERROR (version 3.0.0-RC1, build 299003 from 2007/10/01 23:14:52) : at java.lang.System.arraycopy(Native Method)
    2007/10/08 13:11:38 - Split Fields.0 - ERROR (version 3.0.0-RC1, build 299003 from 2007/10/01 23:14:52) : at org.pentaho.di.trans.steps.fieldsplitter.FieldSplitter.splitField(FieldSplitter.java:87)
    2007/10/08 13:11:38 - Split Fields.0 - ERROR (version 3.0.0-RC1, build 299003 from 2007/10/01 23:14:52) : at org.pentaho.di.trans.steps.fieldsplitter.FieldSplitter.processRow(FieldSplitter.java:227)
    2007/10/08 13:11:38 - Split Fields.0 - ERROR (version 3.0.0-RC1, build 299003 from 2007/10/01 23:14:52) : at org.pentaho.di.trans.steps.fieldsplitter.FieldSplitter.run(FieldSplitter.java:262)
    I am splitting the field into 8 fields. Would this be too many fields for Split Fields?

    Gerry

  3. #3
    Join Date
    May 2006
    Posts
    4,882

    Default

    Did you do get fields again after your javascript intervention... for such problems try to make the smallest transformation you can (including input data) and attach it.

    Regards,
    Sven

  4. #4

    Default

    Sven,
    I have it working with just JavaScript. I could not get it to work using the Split Fields.

    Gerry

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Privacy Policy | Legal Notices | Safe Harbor Privacy Policy

Copyright © 2005 - 2019 Hitachi Vantara Corporation. All Rights Reserved.