Hitachi Vantara Pentaho Community Forums
Results 1 to 7 of 7

Thread: [Spoon] trimming not working - 'String operations' step

  1. #1

    Default [Spoon] trimming not working - 'String operations' step

    Hello,

    I am trying to make a simple trimming operation in one field but I am unable to get it working, can anyone help me pointing what I am doing wrong?

    my goal is to trim the 'country_alpha2' field, as it has values like ' EG', ' LY' and they are supposed to be like 'EG', 'LY' and so on... for that I am using a 'String operations' step, and applying a 'trym type both' into that field, but it isn't working...


    any tips will be highly appreciated,

    regards.spoon files.zip

    Ps. I attach both the transformation I am creating and the excel with the data I use.
    Last edited by _alatriste_; 12-19-2013 at 08:02 AM.

  2. #2
    Join Date
    Apr 2008
    Posts
    1,771

    Default

    What do you mean by "isn't working"?
    Is it because you create a text output file and it has "white spaces"?
    -- Mick --

  3. #3

    Default

    ahm...

    I mean that when I click on 'preview data' before and after the 'trim step' i see no diference on the 'country_alpha2' field I am applying the trimming operation. Empty space are still there (like the dinosaur on the shortest tale ever)

    I not writing the result no any file or database yet, i will populate a geo dimension on a simple data warehouse i am creating with the result of this transformation, but that it's still to come.

  4. #4
    Join Date
    Jun 2012
    Posts
    5,534

    Default

    Trimming only works for spaces and there apparently is no space.
    Use regular expression ,. as delimiter.
    So long, and thanks for all the fish.

  5. #5

    Default

    Thx a lot marabu, that solved my issue.

    uau... how did you know that a space was not there when in preview it did appear?

    Thank you again.

  6. #6
    Join Date
    Jun 2012
    Posts
    5,534

    Default

    I knew when trimming didn't get rid of it
    So long, and thanks for all the fish.

  7. #7

    Default

    blindingly obvious marabu, thx a lot!

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.