Hitachi Vantara Pentaho Community Forums
Results 1 to 5 of 5

Thread: Get the first line from multiple input text file ... Urgent !

  1. #1
    Join Date
    Jan 2017
    Posts
    3

    Unhappy Get the first line from multiple input text file ... Urgent !

    I have 37 text files and I want to get the first line for each file, the first line contain the name of station, I want to get this String and store it in a relationnal table





    I tried that, but Pentaho consider all this 37 file as on file and get the first line, what I want to get the 37 string in the first of each file




    That's what I want, but include file by file in Pentaho it's a ridiculous way, so please help me !


  2. #2
    Join Date
    Aug 2011
    Posts
    236

    Default

    Hi horkslight,

    The way I would do it, create a job that has :-

    1) Trans 1 - Get filelist from source directory (file name) - copy rows to results
    2) Trans 2 (execute for every row - Advanced tab for trans in job) - Sample row and append result to file (if that's what is needed)

    This will loop for each file name in the result.

    HTH
    PDI 8.0.0
    MySQL - 5.6.27
    Redshift - 1.0.1485
    PostgreSQL 8.0.2
    OS - Ubuntu 10.04.2

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

    Default

    Here's another way: Pick up all the files by a regex (.+\.txt) in Text-File-Input, and enable rownumbers on the Content page, so you can use Filter-Rows (rownum = 1) to get all the first rows:


    Name:  218309.png
Views: 183
Size:  14.9 KB
    So long, and thanks for all the fish.

  4. #4
    Join Date
    Jan 2017
    Posts
    3

    Default

    Hi tnewman,


    Can you please give me an example using screenshots, or a tuto or anything can help.
    I understand what you said but I don't know where to start ?

    Thnaks.

  5. #5
    Join Date
    Aug 2011
    Posts
    236

    Default

    Hi horkslight,

    This might help = https://anotherreeshu.wordpress.com/...a-integration/

    Thanks,
    PDI 8.0.0
    MySQL - 5.6.27
    Redshift - 1.0.1485
    PostgreSQL 8.0.2
    OS - Ubuntu 10.04.2

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.