Hitachi Vantara Pentaho Community Forums
Results 1 to 5 of 5

Thread: replace

  1. #1
    Join Date
    Mar 2013
    Posts
    148

    Default replace

    How to replace the string if any text contains some words it has to replace with some value


    For example


    In my csv file i have two columns and multiple rows with pipe delimited format


    Pms|url
    ?Name?,?sno?|http://localhost:8080/pentaho?Name=?Name?&sno=?sno?
    ?Name?,?sno?,?address?|http://localhost:8080/pentaho?Name=?...ress=?address?


    what i need is it has to search and replace the url column whenever the url content contains with pms columns it has to replace with some value


    my final urls has to be formed like below
    output
    ========
    http://localhost:8080/pentaho?Name="aaa"&sno=123
    http://localhost:8080/pentaho?Name="aaa"&sno=123&address="ABCDEFG"

  2. #2
    Join Date
    Mar 2013
    Posts
    148

    Default

    Any Suggestions ?

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

    Default

    Quote Originally Posted by pentaho2013 View Post
    How to replace the string if any text contains some words it has to replace with some value
    When looking for a suitable step enter a filter string - try replace

    You want to build a URL from a template?
    Make sure field values used for subsitution are properly escaped.
    So long, and thanks for all the fish.

  4. #4
    Join Date
    Mar 2013
    Posts
    148

    Default

    But before doing replace i have to search whether that column value is present in that url then i have to do replace.

    How can i search it instead of specifying column value everytime it has to search whatever the columns values are coming in pms it has to search in entire url?

  5. #5
    Join Date
    Nov 2008
    Posts
    777

    Default

    If you try to replace a string that isn't there it will do nothing and proceed. Why do you think you need to search first?

    Also, what is all this "pms" you keep referring to? That's an English acronym most dudes try to avoid...
    pdi-ce-4.4.0-stable
    Java 1.7 (64 bit)
    MySQL 5.6 (64 bit)
    Windows 7 (64 bit)

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.