Hitachi Vantara Pentaho Community Forums
Results 1 to 8 of 8

Thread: How to read the field value when there has line feed?

  1. #1
    Join Date
    Sep 2014
    Posts
    122

    Default How to read the field value when there has line feed?

    Hi,

    Ay one knows how to implement the below logic:

    source file : FILE
    The data in the F1LE:
    F1,F2,F3,F4
    "A","B","C","D"
    "AA","DD
    FF","CC","DD"


    The last row has the line feed in the F2.

    which step can use to reed the above data correctly? how to set?

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

    Default

    You can try to use CSV-Input with option "Newline possible in fields" enabled.
    So long, and thanks for all the fish.

  3. #3
    Join Date
    Sep 2014
    Posts
    122

    Default

    Hi marabu,
    if i use the step "TEXT FILE INPUT", can i do the wanted logic?

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

    Default

    I don't think so.
    Embedded line breaks are not supported in my version of Text-File-Input.
    Only CSV-Input has this feature.
    So long, and thanks for all the fish.

  5. #5
    Join Date
    Sep 2014
    Posts
    122

    Default

    Thanks marabu.

    The CSV input can do the logic. The value of F2 shows as "DDFF" in the preview data page, but the f2 value will also shows as 2 line when i out put the f2 column. how to let the f2 value output as one line "DDFF"?

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

    Default

    I think you need to replace your LF character (Replace in String or Calculator) and then create your ouput file.
    -- Mick --

  7. #7
    Join Date
    Sep 2014
    Posts
    122

    Default

    Hi,

    do you know what is the line feed string in the kettle?

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

    Default

    Hi.
    Have a look at teh calculator step: http://wiki.pentaho.com/display/EAI/Calculator
    One of the operation is: Remove LF from a string A - Removes linefeeds from a string.
    -- Mick --

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.