Hitachi Vantara Pentaho Community Forums
Results 1 to 2 of 2

Thread: Replace Strings

  1. #1
    Join Date
    Jun 2011
    Posts
    3

    Default Replace Strings

    Hi,
    I have to replace strings in a template file. The replacements are in a row and I have to duplicate the template for each row.
    Example:
    Template:
    Hello %NAME%, this is
    a template file number %NUMBER% for test %TESTNAME%

    Replacements:
    %NAME% %NUMBER% %TESTNAME%
    Ben 1 test1
    Peter 245 test234

    Ouput:
    Hello Ben, this is
    a template file number 1 for test test1
    Hello Peter, this is
    a template file number 245 for test test234

    Any ideas, how to solve this ?

    Thanks in advance
    Barney

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

    Default

    You can use a Modified Java Script Value step to implement this mail-merge functionality.
    Load the template once and get a list of the input fields, then replace all the variables in the template.
    Don't forget to add the resulting variable to the output field list.
    So long, and thanks for all the fish.

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.