Hitachi Vantara Pentaho Community Forums
Results 1 to 8 of 8

Thread: CRLF character

  1. #1
    Join Date
    Apr 2011
    Posts
    7

    Wink CRLF character

    Hi,

    Currently I'm using a text editor to get rid of the CRLF at the end of a row, but I was just curious if there is anything in Kettle that can help with that?


    For example from this output:
    Code:
     
    101 Smith 105.60
    101 Marg  100.35
    102 Pete    89.51
    102 John    65.55
    could I get this:
    Code:
     
    101 Smith 105.60101 Marg 100.35102 Pete 89.51102 John 65.55
    Thank you!
    Miha

  2. #2
    Join Date
    Apr 2008
    Posts
    1,771

    Default

    Hi Miha.
    I think that you can use a "Replace in String" and use a regex if CRLF are in the middle of your fields.

    In your example you could probably use a denormaliser step.

    Having said that, I have the same issue and I launch a batch file to execute a text editor from PDI.

    Mick

  3. #3
    Join Date
    Apr 2011
    Posts
    7

    Default

    Hi Mick,

    thanks for your reply. I tried with the denormaliser step but it doesn't work. Because of the format of the file I need, in the end the file should have just one row no matter the key field (in this case that would be 101 or 102 etc). I guess I'll let the text editor do his thing

    Thank you,
    Miha

  4. #4
    Join Date
    Apr 2008
    Posts
    1,771

    Default

    Hi Miha.
    Out of curiosity, which text editor do you use?
    Do you process BIG text files (few Gigs of data)?

    At the moment I use Vedit, but I was looking for a replacement, possible open source.

    Thanks.
    Mick

  5. #5
    Join Date
    Apr 2011
    Posts
    7

    Default

    Hi Mick,

    I use EditPad Pro, but I don't think I ever used it for really big files, no Gb just Mb . And it's not open source.
    There is a free version, but I've never used it, it's called EditPad Lite.

    Miha

  6. #6
    Join Date
    Nov 1999
    Posts
    9,729

    Default

    Code:
    < input.txt tr -d '\n' | tr -d '\r' > output.txt

  7. #7
    Join Date
    Apr 2011
    Posts
    7

    Default

    Hi Matt,

    I don't know what that code means . Can you please explain?

    Thank you very much!
    Miha

  8. #8
    Join Date
    Nov 1999
    Posts
    9,729

    Default

    It's a Unix (Linux, OSX) shell script mainly using the "tr" command (translate). It deletes all newline and carriage return characters.

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.