Hitachi Vantara Pentaho Community Forums
Results 1 to 5 of 5

Thread: Split field to rows delimiter "; "

  1. #1
    Join Date
    Oct 2015
    Posts
    5

    Question Split field to rows delimiter "; "

    Hi,

    It is possible to define a delimiter that consider the union of two delimiter a semicolon with whitespace like this "; "?

    Please take into consideration the following example:
    e.g "Hello world; Hello kettle"

    row1: "Hello world"
    row2: "Hello Kettle"

    When i define a delimiter as "; " it will consider ";" and " " it will happen something like this:
    row1: "Hello"
    row2: "world"
    row3: ""
    row4: "Hello"
    row5: "Kettle"

    Any suggestion would be great.

    Regards,
    Eduardo Pascoal

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

    Default

    Quote Originally Posted by epascoal View Post
    It is possible to define a delimiter that consider the union of two delimiter a semicolon with whitespace like this "; "?
    Yes, you can specify an arbitrary string as row seperator (delimiter). In fact, a semicolon followed by a space will cut your sample data in half producing 2 rows as depicted:

    row1: "Hello world"

    row2: "Hello Kettle"

    Quote Originally Posted by epascoal View Post
    When i define a delimiter as "; " it will consider ";" and " " it will happen something like this:
    row1: "Hello"
    row2: "world"
    row3: ""
    row4: "Hello"
    row5: "Kettle"
    I'm not sure I get the meaning of what you are saying.
    Are you telling us that your Kettle is producing unexpected output?
    Or are you asking for a delimiter that will produce more than 2 rows?
    In that case try \W+ as a regular expression.
    So long, and thanks for all the fish.

  3. #3
    Join Date
    Oct 2015
    Posts
    5

    Default

    Thanks for your answer.

    Quote Originally Posted by marabu View Post
    Yes, you can specify an arbitrary string as row seperator (delimiter). In fact, a semicolon followed by a space will cut your sample data in half producing 2 rows as depicted:

    row1: "Hello world"

    row2: "Hello Kettle"
    Yes, that was what i expected to happen but in my case doesn't work in that way.

    Quote Originally Posted by marabu View Post
    Are you telling us that your Kettle is producing unexpected output?
    Yes, in my case kettle assume that "; " is actually two delimiters ";" and " " which will produce the following result.

    Quote Originally Posted by epascoal View Post
    row1: "Hello"
    row2: "world"
    row3: ""
    row4: "Hello"
    row5: "Kettle"
    Notice that it consider the white space separated from semi-colon.

    I've notice also that when i use another step that uses delimiter like split fields step with the same delimiter "; "the result was different it will show the one that is expected. It will consider the whole string as delimiter instead of each character.

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

    Default

    Now would be a great time to tell us about the Kettle version you are using.

    Hint: You can speed things up by providing a demo transformation consisting of a Data-Grid and a Split-Field-To-Rows step.
    So long, and thanks for all the fish.

  5. #5
    Join Date
    Oct 2015
    Posts
    5

    Default

    yes , you're right. I'm using geokettle.

    Now i've installed the new version of Kettle and this issue doesn't occur anymore.

    Thanks for your help.

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.