<?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 Re: How delete files in folder when max. count is reached? in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/How-delete-files-in-folder-when-max-count-is-reached/m-p/2309891#M81070</link>
    <description>&lt;P&gt;Hi, thanks for the answer. The oldest files should be deleted, what is the runIf Connection? Actually I am deleting files in the tJava but is not working as expected. Can you explain your advice with the runIf connection.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
    <pubDate>Tue, 01 Dec 2020 09:26:18 GMT</pubDate>
    <dc:creator>olja</dc:creator>
    <dc:date>2020-12-01T09:26:18Z</dc:date>
    <item>
      <title>How delete files in folder when max. count is reached?</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-delete-files-in-folder-when-max-count-is-reached/m-p/2309889#M81068</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a folder in which my job will produce a file. This folder should only contain max. 10 files, so if the folder contains already 10 files, I need to delete the oldest file first, before my job can produce a file. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have started with a tFileList --&amp;gt; tFileProperties and then into a tJava component, but it makes no sense &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; I do not need to iterate over all item, I need to get a count of files and if &amp;gt; 10 delete the oldest.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any suggestion?&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Mon, 30 Nov 2020 10:12:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-delete-files-in-folder-when-max-count-is-reached/m-p/2309889#M81068</guid>
      <dc:creator>olja</dc:creator>
      <dc:date>2020-11-30T10:12:43Z</dc:date>
    </item>
    <item>
      <title>Re: How delete files in folder when max. count is reached?</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-delete-files-in-folder-when-max-count-is-reached/m-p/2309890#M81069</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;Normally, the global variable ((Integer)globalMap.get("tFileList_1_NB_FILE"))) is used in the next subjob, eg:&lt;/P&gt;&lt;P&gt;tfilelist--iterate---&amp;gt;....&lt;/P&gt;&lt;P&gt;|onsubjobok&lt;/P&gt;&lt;P&gt;tJava&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;on tJava:&lt;/P&gt;&lt;P&gt;System.out.println("Total file count is: " + ((Integer)globalMap.get("tFileList_1_NB_FILE")));&lt;/P&gt;&lt;P&gt;You will get the total no. of files and make use of RunIf connection type to delete files.&lt;/P&gt;&lt;P&gt; How do you judge the old files that doesn't be needed anymore? By date? Are your files in the folder named by date?&lt;/P&gt;&lt;P&gt;Best regards&lt;/P&gt;&lt;P&gt;Sabrina&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 01 Dec 2020 05:19:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-delete-files-in-folder-when-max-count-is-reached/m-p/2309890#M81069</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-12-01T05:19:23Z</dc:date>
    </item>
    <item>
      <title>Re: How delete files in folder when max. count is reached?</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-delete-files-in-folder-when-max-count-is-reached/m-p/2309891#M81070</link>
      <description>&lt;P&gt;Hi, thanks for the answer. The oldest files should be deleted, what is the runIf Connection? Actually I am deleting files in the tJava but is not working as expected. Can you explain your advice with the runIf connection.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Tue, 01 Dec 2020 09:26:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-delete-files-in-folder-when-max-count-is-reached/m-p/2309891#M81070</guid>
      <dc:creator>olja</dc:creator>
      <dc:date>2020-12-01T09:26:18Z</dc:date>
    </item>
  </channel>
</rss>

