Hitachi Vantara Pentaho Community Forums
Results 1 to 7 of 7

Thread: Get real file names from a folder without selecting the file

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Dec 2016
    Posts
    23

    Default Get real file names from a folder without selecting the file

    Hi,

    Is there an option to get the file(s) name in a folder, without selecting the file?

    I only have the folder path and I need to detect if there is a file and then get the file name.

    Thanks

  2. #2
    Join Date
    Aug 2011
    Posts
    236

    Default

    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
    Dec 2016
    Posts
    23

    Default

    Yes, that is the step that I'm using, however I'm including the folder path in "file or directory" but it is returning the folder name as the filename. I don't know how define that search files inside that folder

  4. #4
    Join Date
    Nov 2013
    Posts
    382

    Default

    I guess you need to specify the regexp for all files:

    .*\..*
    Last edited by DepButi; 10-27-2017 at 11:07 AM. Reason: Missing dot!

  5. #5
    Join Date
    Dec 2016
    Posts
    23

    Default

    Thanks! yes I understand how "Get File Names" works and I'm using it.

    However I have another question... once I using it I need to send the filename to a "send mail" but other constants can not be reading by the mail. it is showing a message that "Get File Names" contain 12 or more rows and so I'm mixing rows order.

    How can I extract the fieldname column only or the uri field only? I use "select values" but I received the message again, maybe I'm using wrong

    So I don't know if is better to use add filenames to result in the job but I dont know how set a new variable with the result to use it in the transformation... do you know how can I save results in a variable?

  6. #6
    Join Date
    Nov 2013
    Posts
    382

    Default

    Quote Originally Posted by Cris123 View Post
    However I have another question... once I using it I need to send the filename to a "send mail" but other constants can not be reading by the mail. it is showing a message that "Get File Names" contain 12 or more rows and so I'm mixing rows order.
    Sorry, I cannot understand ... could you post your transformation so we can take a look. Unsure of what are you trying to do! "contain 12 or more rows" is meaningless to me! I guess the exact message is not that one and probably coming from another step.

    Quote Originally Posted by Cris123 View Post
    How can I extract the fieldname column only or the uri field only? I use "select values" but I received the message again, maybe I'm using wrong
    The get file names step provides all parts on its own:
    filename : full specification
    short_filename : just file and extension
    path : just the path
    uri and rooturi also available

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.