LAE

Welcome to the LAE community!  Please feel free to start a discussion in the discussion tab or join in a conversation.

Discussions

Members

Resources

Events

 View Only
  • 1.  Check if input file exists and if it doesn't, then pass a dummy file

    Employee
    Posted 09-04-2014 03:29

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: cristi.boizas

    Hello, guys. I am trying to make a data flow which firstly checks if a file is present on the server or not. If the file is there I have to read it and continue the processing, if the file is missing, I need to generate a temporary file ( like a dummy file) which will run through the graph. The problem is that I have to concatenate another file with one of those, and this translates into having 3 inputs on the CAT node, one of which will always be empty.

    I tried passing the two nodes ( dummy node and delimited file node) through a bypass node before the concatenation( which is actually a union), but when the file is missing from the server, the bypass node doesn't pass the dummy file to CAT. Any ideas?


  • 2.  RE: Check if input file exists and if it doesn't, then pass a dummy file

    Employee
    Posted 09-04-2014 08:14

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: ltolleson

    I have attached a sample graph that will do what you are asking. It is not the most elegant since it requires the use of a dummyFile, but it does work. The requirement is that the dummyFile must have the same header as the file you are attempting to read. Basically the filter node checks to see if the file was available. If the file exist it uses the file, else it copies the dummyFile into the fileName you expect.

    I have included a graph parameter called DataDirectory which you will need to insert the directory where your files are located.

    I'm sure there are other ways...

    Thanks,
    Larry
    Attachments:
    FileExistenceCheck.zip


  • 3.  RE: Check if input file exists and if it doesn't, then pass a dummy file

    Employee
    Posted 09-10-2014 04:32

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: cristi.boizas

    Hi Larry,
    Thanks! This works, but is there any way the dummy file could be generated if the other file does not exist? The input files for my solution come from another system and I use LAE to read them from the dump directory and I don't want the dummy to be created unless the source file is missing. I did this through shell scripting, but I wanted to do it with LAE.


  • 4.  RE: Check if input file exists and if it doesn't, then pass a dummy file

    Employee
    Posted 09-11-2014 15:24

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: ltolleson

    Originally posted by: cristi.boizas
    					

    Hi Larry,
    Thanks! This works, but is there any way the dummy file could be generated if the other file does not exist? The input files for my solution come from another system and I use LAE to read them from the dump directory and I don't want the dummy to be created unless the source file is missing. I did this through shell scripting, but I wanted to do it with LAE.
    Here is another version that is not dependent on the dummy file being on the server. The graph creates the dummy file, uses it if needed, and then deletes the dummy file at the end.

    FileExistenceCheck2.zip