<?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 Delete files with timestamp rule in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/Delete-files-with-timestamp-rule/m-p/2202579#M4231</link>
    <description>&lt;P&gt;Hello everyone,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a directory where I put files every minute. I want this directory to delete the files&amp;nbsp; which are there over 8 days. How is this possible?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks a lot.&lt;/P&gt;</description>
    <pubDate>Tue, 14 Apr 2020 10:29:29 GMT</pubDate>
    <dc:creator>DrGenious</dc:creator>
    <dc:date>2020-04-14T10:29:29Z</dc:date>
    <item>
      <title>Delete files with timestamp rule</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Delete-files-with-timestamp-rule/m-p/2202579#M4231</link>
      <description>&lt;P&gt;Hello everyone,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a directory where I put files every minute. I want this directory to delete the files&amp;nbsp; which are there over 8 days. How is this possible?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks a lot.&lt;/P&gt;</description>
      <pubDate>Tue, 14 Apr 2020 10:29:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Delete-files-with-timestamp-rule/m-p/2202579#M4231</guid>
      <dc:creator>DrGenious</dc:creator>
      <dc:date>2020-04-14T10:29:29Z</dc:date>
    </item>
    <item>
      <title>Re: Delete files with timestamp rule</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Delete-files-with-timestamp-rule/m-p/2202580#M4232</link>
      <description>&lt;P&gt;Using tFileProperties you can access the mtime field which represents the last modification date for the file.&lt;/P&gt;
&lt;P&gt;Then you just have to compare with actual datetime to decide to delete the file or not.&lt;/P&gt;
&lt;P&gt;Here is the design:&lt;/P&gt;
&lt;P&gt;tFileList--(iterate)--&amp;gt;tFileProperties--(main)--&amp;gt;tFlowToIterate--(OnComponentOk)--(If)--&amp;gt;tFileDelete&lt;/P&gt;
&lt;P&gt;And here is the condition for the "If" trigger:&lt;/P&gt;
&lt;PRE&gt;((TalendDate.getCurrentDate()).getTime() - (Long)globalMap.get("row1.mtime")) &amp;gt; (8 * 24 * 3600000)&lt;/PRE&gt;
&lt;P&gt;This suppose the flow after tFileProperties is called "row1".&lt;/P&gt;
&lt;P&gt;If not, you just have to adjust the condition with the real flow name.&lt;/P&gt;</description>
      <pubDate>Tue, 14 Apr 2020 11:17:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Delete-files-with-timestamp-rule/m-p/2202580#M4232</guid>
      <dc:creator>TRF</dc:creator>
      <dc:date>2020-04-14T11:17:29Z</dc:date>
    </item>
    <item>
      <title>Re: Delete files with timestamp rule</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Delete-files-with-timestamp-rule/m-p/2202581#M4233</link>
      <description>&lt;P&gt;&lt;A href="https://community.qlik.com/s/profile/0053p000007LKj7AAG"&gt;@TRF&lt;/A&gt;&amp;nbsp;thank you a lot really.&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;I want to ask you also something if You know.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;I create this CSV and I &lt;STRONG&gt;&lt;EM&gt;append&lt;/EM&gt;&lt;/STRONG&gt; this info inside :&lt;/P&gt; 
&lt;PRE&gt;pw.println(TalendDate.formatDate("yyyy-MM-dd HH:mm:ss", TalendDate.getCurrentDate()) + " , " + "Error in reading file: " + ((String)globalMap.get("tWaitForFile_2_FILENAME")) + " , " + "Error: " + input_row.errorMessage);&lt;/PRE&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;In this case which is &lt;STRONG&gt;&lt;EM&gt;one file&lt;/EM&gt;&lt;/STRONG&gt; but I want to&lt;STRONG&gt;&lt;EM&gt; delete row&lt;/EM&gt;&lt;EM&gt;s&lt;/EM&gt;&lt;/STRONG&gt; from the CSV after 8 days, how can I do it?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 14 Apr 2020 11:28:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Delete-files-with-timestamp-rule/m-p/2202581#M4233</guid>
      <dc:creator>DrGenious</dc:creator>
      <dc:date>2020-04-14T11:28:30Z</dc:date>
    </item>
    <item>
      <title>Re: Delete files with timestamp rule</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Delete-files-with-timestamp-rule/m-p/2202582#M4234</link>
      <description>This is not the same question but the previous one may help you. For this one you have to read the file (tFileInputDelimited) then filter rows within a tMap using the appropriate comparison methods.
&lt;BR /&gt;I strongly suggest you to try a little by yourself as you have the keys with the previous question (which could be marked as solved).</description>
      <pubDate>Tue, 14 Apr 2020 11:42:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Delete-files-with-timestamp-rule/m-p/2202582#M4234</guid>
      <dc:creator>TRF</dc:creator>
      <dc:date>2020-04-14T11:42:38Z</dc:date>
    </item>
  </channel>
</rss>

