<?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: File delete in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/File-delete/m-p/2225374#M17686</link>
    <description>Hi all,&lt;BR /&gt;&lt;BR /&gt;Any suggestions on the below&lt;BR /&gt;&lt;BR /&gt;Thanks in advance,&lt;BR /&gt;Lmit</description>
    <pubDate>Wed, 18 Mar 2020 12:35:25 GMT</pubDate>
    <dc:creator>lmit</dc:creator>
    <dc:date>2020-03-18T12:35:25Z</dc:date>
    <item>
      <title>File delete</title>
      <link>https://community.qlik.com/t5/Talend-Studio/File-delete/m-p/2225367#M17679</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a zip files with dates as file name so i have to delete the files which are 5 days older to current date, how can i achieve this, i tried tfileproperties component from the forum which uses file creation date&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;is there a way where i can use file name date for deletion?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance,&lt;/P&gt;&lt;P&gt;lmit&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 03 Mar 2020 09:09:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/File-delete/m-p/2225367#M17679</guid>
      <dc:creator>lmit</dc:creator>
      <dc:date>2020-03-03T09:09:52Z</dc:date>
    </item>
    <item>
      <title>Re: File delete</title>
      <link>https://community.qlik.com/t5/Talend-Studio/File-delete/m-p/2225368#M17680</link>
      <description>&lt;P&gt;Into a tJava component, use TalendDate.addDate to get the current date minus 5 days and TalendDate.formatDate to format the result as expected and store the result to a global variable:&lt;/P&gt; 
&lt;PRE&gt;globalMap.put("theDate",&amp;nbsp;TalendDate.formatDate("yyyyMMdd", TalendDate.addDate(TalendDate.getCurrentDate(), -5,"dd")));&lt;/PRE&gt; 
&lt;P&gt;Then, use a tFileList component to get all file with the desired mask:&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="date.png" style="width: 702px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M9sY.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/142614i6C757B019BC8233D/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M9sY.png" alt="0683p000009M9sY.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;Finally, use tFileDelete to all corresponding files.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 03 Mar 2020 09:34:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/File-delete/m-p/2225368#M17680</guid>
      <dc:creator>TRF</dc:creator>
      <dc:date>2020-03-03T09:34:08Z</dc:date>
    </item>
    <item>
      <title>Re: File delete</title>
      <link>https://community.qlik.com/t5/Talend-Studio/File-delete/m-p/2225369#M17681</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks TRF for your suggestion i did as your suggested but only one file is getting deleted not the other files which are greater than 5.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It should all the zip files which are greater than 5 days&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;lmit&lt;/P&gt;</description>
      <pubDate>Tue, 03 Mar 2020 11:44:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/File-delete/m-p/2225369#M17681</guid>
      <dc:creator>lmit</dc:creator>
      <dc:date>2020-03-03T11:44:11Z</dc:date>
    </item>
    <item>
      <title>Re: File delete</title>
      <link>https://community.qlik.com/t5/Talend-Studio/File-delete/m-p/2225370#M17682</link>
      <description>If you need to delete files older than 5 days, you need to get all files, extract the date part from the filename, convert it into a date and compare the result to the current date minus 5 days.
&lt;BR /&gt;Here is what the job should look like:
&lt;BR /&gt;tFileList--(iterate)--&amp;gt;tJava--(If)--&amp;gt;tFileDelete</description>
      <pubDate>Tue, 03 Mar 2020 12:28:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/File-delete/m-p/2225370#M17682</guid>
      <dc:creator>TRF</dc:creator>
      <dc:date>2020-03-03T12:28:57Z</dc:date>
    </item>
    <item>
      <title>Re: File delete</title>
      <link>https://community.qlik.com/t5/Talend-Studio/File-delete/m-p/2225371#M17683</link>
      <description>Hi TRF,&lt;BR /&gt;&lt;BR /&gt;Thanks for the reply but My file names have only date , I followed the process you said but still only one file is getting deleted.&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Lmit</description>
      <pubDate>Fri, 06 Mar 2020 12:59:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/File-delete/m-p/2225371#M17683</guid>
      <dc:creator>lmit</dc:creator>
      <dc:date>2020-03-06T12:59:51Z</dc:date>
    </item>
    <item>
      <title>Re: File delete</title>
      <link>https://community.qlik.com/t5/Talend-Studio/File-delete/m-p/2225372#M17684</link>
      <description>Share your job design with components settings and an example filename</description>
      <pubDate>Fri, 06 Mar 2020 17:13:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/File-delete/m-p/2225372#M17684</guid>
      <dc:creator>TRF</dc:creator>
      <dc:date>2020-03-06T17:13:21Z</dc:date>
    </item>
    <item>
      <title>Re: File delete</title>
      <link>https://community.qlik.com/t5/Talend-Studio/File-delete/m-p/2225373#M17685</link>
      <description>&lt;P&gt;Hi TRF,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;my file names will be 2020-03-10.zip&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please find the attachment for the job design.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;in if link, the condition is&amp;nbsp;&lt;/P&gt;&lt;P&gt;context.comapredate &amp;gt;=1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;lmit&lt;/P&gt;&lt;BR /&gt;&lt;A href="https://community.qlik.com/legacyfs/online/tlnd_dw_files/0683p000009Ly27"&gt;delete.PNG&lt;/A&gt;</description>
      <pubDate>Tue, 10 Mar 2020 13:42:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/File-delete/m-p/2225373#M17685</guid>
      <dc:creator>lmit</dc:creator>
      <dc:date>2020-03-10T13:42:51Z</dc:date>
    </item>
    <item>
      <title>Re: File delete</title>
      <link>https://community.qlik.com/t5/Talend-Studio/File-delete/m-p/2225374#M17686</link>
      <description>Hi all,&lt;BR /&gt;&lt;BR /&gt;Any suggestions on the below&lt;BR /&gt;&lt;BR /&gt;Thanks in advance,&lt;BR /&gt;Lmit</description>
      <pubDate>Wed, 18 Mar 2020 12:35:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/File-delete/m-p/2225374#M17686</guid>
      <dc:creator>lmit</dc:creator>
      <dc:date>2020-03-18T12:35:25Z</dc:date>
    </item>
  </channel>
</rss>

