Hitachi Vantara Pentaho Community Forums
Results 1 to 10 of 10

Thread: How to search multiple files in File Exists Job Entry?

  1. #1

    Default How to search multiple files in File Exists Job Entry?

    Hi All,

    I am using version 2.5.1. In my transformation I wanted to start a Job if some file exists in a particular folder. I can achieve this by using “File Exists” job entry. But I can’t check multiple files. And also the file name is not constant and I need to provide a wild card to search for the file name. Is there any option for this in 2.5.1 or in later versions? Please help.

    Thanks,
    Darius

  2. #2
    Join Date
    Nov 1999
    Posts
    9,729

    Default

    There are always multiple ways to get something done using Kettle.
    For example, you could solve it in JavaScript or (my personal favorite) use the "Get File Names" step in a transformation where you set rows in the result object.
    And then you can examine the number of files found, etc.
    I guess that would be easier.

    Matt

  3. #3

    Smile

    Hi,

    For my personal needs, i created a "check if folder is empty" job entry.
    Like the title said, this job entry check if a folder is empty.
    I added the ability to limit search to a specified wildcard.

    The job entry will search for files that verify your wildcard, if noting was found , the result will be TRUE (folder is empty) otherwise FALSE (we found at least one file).

    I don't know if it feets ypur need? anyway this job entry will be available starting PDI 3.1.

    Rgds

    Samatar
    Last edited by shassan2; 01-24-2008 at 06:06 AM.

  4. #4

    Default

    Hi,

    I tried Get File Names step. Its working if there are some files with the specified name. If there are no files in the folder, the step is throwing error. I can’t proceed without any files in the folder.
    Is the 3.1 version available for download?
    Please help.

    Thanks,
    Darius

  5. #5
    Join Date
    May 2006
    Posts
    4,882

    Default

    In 3.0GA the get file names step works even when there are no files... please try again and attach the errors you get.

    Regards,
    Sven

  6. #6

    Default

    Hi Sevn,

    Please look into the attached error message, the version I am using is 3.0 GA. Its giving the same error “ No files Found!” I have also attached the Get File Names step which I am using.

    Thanks,
    Darius
    Attached Images Attached Images   

  7. #7
    Join Date
    Apr 2007
    Posts
    21

    Default

    Hello,

    your wildcard for PARTNER*.* is wrong. Should be PARTNER.*\.*

    Regards
    Volker

  8. #8

    Default

    Hi,

    I just downloade Version 3.0.1. I want to use the step (check if folder is empty) which Smatar quoted. Please let me know where this step is available and how to use this to check for multiple files.

    Thanks,
    Darius

    Quote Originally Posted by shassan2 View Post
    Hi,

    For my personal needs, i created a "check if folder is empty" job entry.
    Like the title said, this job entry check if a folder is empty.
    I added the ability to limit search to a specified wildcard.

    The job entry will search for files that verify your wildcard, if noting was found , the result will be TRUE (folder is empty) otherwise FALSE (we found at least one file).

    I don't know if it feets ypur need? anyway this job entry will be available starting PDI 3.1.

    Rgds

    Samatar

  9. #9

    Default

    Hi,

    This job entry will be available in 3.1.

    Rgds

    Samatar

  10. #10

    Default

    Hi,

    I am using version 3.0.1 and i tried the Get file name step to check if there are any files. If present load the files through XML Input else do nothing. But I am getting the following error.

    ERROR (version 3.0.1, build 534 from 2007/12/12 12:28:23) : Step [XML Input.0] failed to initialize!

    I have also attached a sample Transformation file. Please look into it and let me know if there are any errors and also let me know how to achive it.

    Thanks,
    Darius

    Quote Originally Posted by sboden View Post
    In 3.0GA the get file names step works even
    when there are no files... please try again and attach the errors you get.

    Regards,
    Sven
    Attached Files Attached Files

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.