Hitachi Vantara Pentaho Community Forums
Results 1 to 10 of 10

Thread: How to convert all Strings to UPPER case?

  1. #1

    Default How to convert all Strings to UPPER case?

    Hi All,
    I am loading data from XML file to a Database table. In the transformation I want to change all the strings to Upper case when loading into table. Is there any way to achieve it? Please help.

    Thanks,
    Darius

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

    Default

    modified javascript... do an upper() on each field.

    Regards,
    Sven

  3. #3

    Default

    Hi Sven,

    I am new to java scripts, can you give some example to How to use Modified java scripts.

    Thanks again,
    Darius

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

    Default

    Look in your Kettle directory under samples\transformations for the ones that start with Javascript, the FAQ has a few examples as well.

    Regards,
    Sven
    Attached Files Attached Files
    Last edited by sboden; 09-05-2007 at 03:25 AM.

  5. #5

    Default

    Thanks Sven,

    I found it. Its working.

    Regards,
    Darius

  6. #6
    Join Date
    Mar 2009
    Posts
    9

    Default Upper case all strings without field reference

    There seem to be a few ways to format the case of string fields, but often times I need to modify an entire record set from an export off of a system that is all upper, lower or mixed and I need to standardize the entire record upper or lower case. Since the number of fields can be dozens to hundreds and vary from run to run, is there a way to specify that all values should be affected to a the requested format?

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

    Default

    No unless Samatar comes along and makes a new step

    Regards,
    Sven

  8. #8

    Default

    Just a suggestion but you can also try the Regex Evaluation or Replace in String steps for case conversions... Regex Evaluation looks like it might be a little easier when doing large numbers of conversions.

    Keith

  9. #9
    Join Date
    Apr 2008
    Posts
    4,696

    Default

    This might slow your data extract down...
    But if I recall correctly, most DB Engines support calls along the lines of:

    select UPPER(string1), UPPER(string2), date from [Table]

  10. #10
    Join Date
    Mar 2009
    Posts
    9

    Default Upper Case All values

    We are not using a database at this point rather working with flat files. One suggestion we are looking at is to create a pre-step or job that calls the pipe delimited record as tab delimited, causing it to read the entire line as one field. Then uppper case it as normal, saving the output to a file. I have done this to get the field names and read them into a layout as a variable step. So I believe this would work as well.

    Optionally, could I direct this result output to the text input step as if I read it from the disk?

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.