<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Current File Path from tWaitForFile in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/Current-File-Path-from-tWaitForFile/m-p/2249098#M33745</link>
    <description>I'm using the tWaitForFile component to get all files from a particular directory.&amp;nbsp; Files may exist in this directory prior to the start of my Job, and will certainly be added to this directory during the execution of my job. 
&lt;BR /&gt;Therefore, I have configured the 
&lt;I&gt;tWaitForFile &lt;/I&gt;to "Include Present File" and "Trigger action when a file is created". 
&lt;BR /&gt;After finding a file, I need to read that file (using 
&lt;I&gt;tFileInputDelimited&lt;/I&gt;), so I have connected to that component using an 
&lt;I&gt;Iterate &lt;/I&gt;link - using 
&lt;I&gt;Main &lt;/I&gt;to feed 
&lt;I&gt;tFileInputDelimited &lt;/I&gt;does not seem to be possible. 
&lt;BR /&gt;So far, I have 
&lt;B&gt;tWaitForFile --&amp;gt; Iterate --&amp;gt; tFileInputDelimited&lt;/B&gt; 
&lt;BR /&gt;However, to read the file, I need the full file path.&amp;nbsp; There does not appear to be a "safe" way to get this from the 
&lt;I&gt;tWaitForFile &lt;/I&gt;component.&amp;nbsp; 
&lt;I&gt;tWaitForFile &lt;/I&gt;sets a number of values that might be useful, but none is fully appropriate: 
&lt;BR /&gt; 
&lt;BR /&gt; 
&lt;B&gt;FILENAME &lt;/B&gt;- this is the current file, but only the file name itself - the path is not included. 
&lt;BR /&gt; 
&lt;B&gt;PRESENT_FILE&lt;/B&gt; - this is the absolute path of the file, but only if it is a "pre-existing" file 
&lt;BR /&gt; 
&lt;B&gt;CREATED_FILE&lt;/B&gt; - this is the absolute path of the file, but only if it is a "new" file 
&lt;BR /&gt;If I use 
&lt;B&gt;FILENAME &lt;/B&gt;- I don't get the path, so I can't open the file. 
&lt;BR /&gt;If I use 
&lt;B&gt;PRESENT_FILE&lt;/B&gt; or 
&lt;B&gt;CREATED_FILE&lt;/B&gt;, I get the full path - but I have to guess which one to use for each file, since there's no variable set saying if the current file is "present" or "created". 
&lt;BR /&gt;Also, there appears to be a risk using 
&lt;B&gt;CREATED_FILE&lt;/B&gt;; this is never set back to 
&lt;B&gt;null&lt;/B&gt; after finishing processing all the pre-existing files, so it remains set to the path of a file that has already been processed. 
&lt;BR /&gt;Can anyone suggest a good way to get the correct full path to the current file from 
&lt;I&gt;tWaitForFile&lt;/I&gt;?</description>
    <pubDate>Thu, 30 Apr 2015 09:32:58 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2015-04-30T09:32:58Z</dc:date>
    <item>
      <title>Current File Path from tWaitForFile</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Current-File-Path-from-tWaitForFile/m-p/2249098#M33745</link>
      <description>I'm using the tWaitForFile component to get all files from a particular directory.&amp;nbsp; Files may exist in this directory prior to the start of my Job, and will certainly be added to this directory during the execution of my job. 
&lt;BR /&gt;Therefore, I have configured the 
&lt;I&gt;tWaitForFile &lt;/I&gt;to "Include Present File" and "Trigger action when a file is created". 
&lt;BR /&gt;After finding a file, I need to read that file (using 
&lt;I&gt;tFileInputDelimited&lt;/I&gt;), so I have connected to that component using an 
&lt;I&gt;Iterate &lt;/I&gt;link - using 
&lt;I&gt;Main &lt;/I&gt;to feed 
&lt;I&gt;tFileInputDelimited &lt;/I&gt;does not seem to be possible. 
&lt;BR /&gt;So far, I have 
&lt;B&gt;tWaitForFile --&amp;gt; Iterate --&amp;gt; tFileInputDelimited&lt;/B&gt; 
&lt;BR /&gt;However, to read the file, I need the full file path.&amp;nbsp; There does not appear to be a "safe" way to get this from the 
&lt;I&gt;tWaitForFile &lt;/I&gt;component.&amp;nbsp; 
&lt;I&gt;tWaitForFile &lt;/I&gt;sets a number of values that might be useful, but none is fully appropriate: 
&lt;BR /&gt; 
&lt;BR /&gt; 
&lt;B&gt;FILENAME &lt;/B&gt;- this is the current file, but only the file name itself - the path is not included. 
&lt;BR /&gt; 
&lt;B&gt;PRESENT_FILE&lt;/B&gt; - this is the absolute path of the file, but only if it is a "pre-existing" file 
&lt;BR /&gt; 
&lt;B&gt;CREATED_FILE&lt;/B&gt; - this is the absolute path of the file, but only if it is a "new" file 
&lt;BR /&gt;If I use 
&lt;B&gt;FILENAME &lt;/B&gt;- I don't get the path, so I can't open the file. 
&lt;BR /&gt;If I use 
&lt;B&gt;PRESENT_FILE&lt;/B&gt; or 
&lt;B&gt;CREATED_FILE&lt;/B&gt;, I get the full path - but I have to guess which one to use for each file, since there's no variable set saying if the current file is "present" or "created". 
&lt;BR /&gt;Also, there appears to be a risk using 
&lt;B&gt;CREATED_FILE&lt;/B&gt;; this is never set back to 
&lt;B&gt;null&lt;/B&gt; after finishing processing all the pre-existing files, so it remains set to the path of a file that has already been processed. 
&lt;BR /&gt;Can anyone suggest a good way to get the correct full path to the current file from 
&lt;I&gt;tWaitForFile&lt;/I&gt;?</description>
      <pubDate>Thu, 30 Apr 2015 09:32:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Current-File-Path-from-tWaitForFile/m-p/2249098#M33745</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-04-30T09:32:58Z</dc:date>
    </item>
    <item>
      <title>Re: Current File Path from tWaitForFile</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Current-File-Path-from-tWaitForFile/m-p/2249099#M33746</link>
      <description>Hi 
&lt;BR /&gt;You can set the full path to the current file with this expression on tFileInputDelimited: 
&lt;BR /&gt;"your particular directory/"+((String)globalMap.get("tWaitForFile_1_FILENAME")) 
&lt;BR /&gt;Best regards 
&lt;BR /&gt;Shong</description>
      <pubDate>Mon, 04 May 2015 07:57:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Current-File-Path-from-tWaitForFile/m-p/2249099#M33746</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-05-04T07:57:03Z</dc:date>
    </item>
  </channel>
</rss>

