Hitachi Vantara Pentaho Community Forums
Results 1 to 3 of 3

Thread: Wild chars?

  1. #1

    Question Wild chars?

    Hi!

    What are the wild characters in Kettle?
    Here is my problem:
    I have a string field and I want to select rows where it contains like bla + bla + bla + bla
    (bla can be anything). In other words, I'm looking for words that containst at least 3 + signs.
    In SQL it is easy: like '%+%+%+%'. I've tried this in a Filter Step, but didn't work.
    So what is the % in Pentaho language?
    Any idea how to make this in a Filter step?

    Thanks

  2. #2
    Join Date
    Apr 2008
    Posts
    4,690

    Default

    I'm not sure what version of PDI you are using, but Filter in 4.0.1 has the option REGEXP rather than LIKE.
    So, you need to build a Java RegEx that meets what you need: .*\+.*\+.*\+.*
    Breakdown:
    .* -> 0 or more of any character
    \+ -> Specifically "+" (the \ is an escape saying treat the next character literally)
    **THIS IS A SIGNATURE - IT GETS POSTED ON (ALMOST) EVERY POST**
    I'm no expert.
    Take my comments at your own risk.

    PDI user since PDI 3.1
    PDI on Windows 7 & Linux

    Please keep in mind (and this may not apply to this thread):
    No forum member is going to do your work for you. We will help you sort out how to do a specific part of the work, as best we can, in the timelines that our work will allow us.
    Signature Updated: 2014-06-30

  3. #3

    Default

    Thanks gutlez, it worked.
    I ususally try to avoid Regular Expressions, because I always make a mistake

Tags for this Thread

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.