Hitachi Vantara Pentaho Community Forums
Results 1 to 3 of 3

Thread: Can Kettle extract data from plain text file (File type: non CSV, non fixed )?

  1. #1
    Join Date
    Dec 2010
    Posts
    6

    Default Can Kettle extract data from plain text file (File type: non CSV, non fixed )?

    Hi all,

    May i know is kettle able extract data from non-fixed, non csv filetype?

    below is the sample content of the file:
    -----------
    2011-01-28 00:20:58.568 DEBUG [[Start] some logs (abcdef)...] [OrdId: 1234789012; OrdAmt: 30] some other logs ...

    some other logs ...
    some other logs some other logs ...
    some other logs ...

    2011-01-28 00:20:58.577 DEBUG [[End] some logs...] [OrdId: 1234789012; OrdAmt: 30] some other logs ...

    some other logs ...
    some other logs some other logs ...
    some other logs ...

    2011-01-28 00:20:58.568 DEBUG [[Start] some logs (xcvbn)...] [OrdId: 1234780001; OrdAmt: 30] some other logs ...

    some other logs ...
    some other logs some other logs ...
    some other logs ...

    2011-01-28 00:20:58.577 DEBUG [[End] some logs...] [OrdId: 1234780001; OrdAmt: 30] some other logs ...

    some other logs ...

    -----------

    I try to extract the start and end timestamp for different OrdId and OrdAmt.

    Appreciate if anyone can help to provide some hints or sample program.
    Thanks

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

    Default

    Hi.
    I would try with the step "Text File input" and use "[" as a delimiter.
    You can then remove some columns that you dont need.

    After that, I would used another step, "Split Fields", to get the 2 columns, OrdId and OrdAmt.

    Hope this help.
    Mick

  3. #3
    Join Date
    Sep 2007
    Posts
    834

    Default

    another approach:
    using regular expressions, and capturing groups. (Scripting --> Regexp Evaluation step)

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.