Hitachi Vantara Pentaho Community Forums
Results 1 to 7 of 7

Thread: Stripping out the carriage return from strings

  1. #1

    Default Stripping out the carriage return from strings

    Attachment: JavaScript - Strip line feeds from text.ktr I have some data that when entered into the Borand Interbase database via a application contains the carriage return character. (its that little hollow square). I want to strip this from all the string using kettle. How might i go about this. I remember trying to do this before using kettle but having no luck =(



  2. #2
    Join Date
    Nov 1999

    Default RE: Stripping out the carriage return from strings

    Matt Casters, Chief Data Integration
    Pentaho, Open Source Business Intelligence --

    Author of the book Pentaho Kettle Solutions by Wiley. Also available as e-Book and on the Kindle reading applications (iPhone, iPad, Android, Kindle devices, ...)

    Join us on IRC server, channel ##pentaho

  3. #3

    Default RE: Stripping out the carriage return from strings

    Cheers Matt! Worked a treat!


  4. #4


    Can't see attachment.
    what is the solution then?

    Thanks for your answer.

  5. #5
    Join Date
    Jun 2007


    Hi there. It appears that this attachment is no longer available... can I have it updated please? If there is an easier solution for the import of large files that have embedded carriage returns, just let me know. Have searched this forum, but not found a solution yet.

    Quote Originally Posted by MattCasters View Post

  6. #6
    Join Date
    Oct 2006

    Default Check the samples

    If you look in your PDI directory you will fine the sample here:

    samples/transformations/JavaScript - Strip line feeds from text.ktr

    There's all sorts of funky samples there

    Harris - Ivy Information Systems

    Come join the non official Pentaho IRC chat room on in the ##pentaho channel

  7. #7
    DEinspanjer Guest


    Although with the new User Defined Java Expression step in 3.2, I believe it would be much faster to have a Java expression: MyField.replace("\r", ""); or, if you can find a suitable single character replacement, even faster would be MyField.replace('\r', '?'); because it requires fewer string operations.

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 - 2017 Pentaho Corporation. All Rights Reserved.