<?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 How to retrieve the last 8 files from F in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/How-to-retrieve-the-last-8-files-from-F/m-p/2337080#M105458</link>
    <description>&lt;P&gt;Hello everyone,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a Talend job which will do the following:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Grab the most recent 4 files from an FTP server and copy them over to my Talend Server for processing. The files are uploaded one everyday &lt;/LI&gt;&lt;LI&gt;I am using FTPList to see all the different files and dates associated with them. At this moment. I have used a tLogRow to print out the details from the global variables using Iteratetoflow on my TfileList component.&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What is the best way to move the most recent 4 files from my FTP server to Talend Server for processing? Also:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Once the files are in the Talend Server I want to process the files based on todays date. So for instance the filename is XYZ_20210410.csv I would need some type of filemask that would (A) be updated on a daily basis so the filemask would become tomorrow *20210411.csv for instance so it grabs the file dated for today from the 8 files it grabbed initially from the FTP Server.&lt;/LI&gt;&lt;LI&gt;The file would then be processed and some sql queries would be run to push this into a postgres DB which I have built the job for. &lt;/LI&gt;&lt;LI&gt;I would then like to iterate over the next 3 files and reprocess them just in case there was an issue to the processing the previous day.&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My main issues are how to grab only the last 4 files based on recency and then processing the files by date using a mask on their names as they also have a date. I think I would need to have a logic that is able to store the filenames date and compare it to a global variable whose date gets updated daily and is saved as a context variable and then compare and run the job if they match. Any help would be super appreciated as I am very new to this amazing tool.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you all.&lt;/P&gt;</description>
    <pubDate>Sat, 16 Nov 2024 00:16:27 GMT</pubDate>
    <dc:creator>Nawaz26893</dc:creator>
    <dc:date>2024-11-16T00:16:27Z</dc:date>
    <item>
      <title>How to retrieve the last 8 files from F</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-retrieve-the-last-8-files-from-F/m-p/2337080#M105458</link>
      <description>&lt;P&gt;Hello everyone,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a Talend job which will do the following:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Grab the most recent 4 files from an FTP server and copy them over to my Talend Server for processing. The files are uploaded one everyday &lt;/LI&gt;&lt;LI&gt;I am using FTPList to see all the different files and dates associated with them. At this moment. I have used a tLogRow to print out the details from the global variables using Iteratetoflow on my TfileList component.&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What is the best way to move the most recent 4 files from my FTP server to Talend Server for processing? Also:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Once the files are in the Talend Server I want to process the files based on todays date. So for instance the filename is XYZ_20210410.csv I would need some type of filemask that would (A) be updated on a daily basis so the filemask would become tomorrow *20210411.csv for instance so it grabs the file dated for today from the 8 files it grabbed initially from the FTP Server.&lt;/LI&gt;&lt;LI&gt;The file would then be processed and some sql queries would be run to push this into a postgres DB which I have built the job for. &lt;/LI&gt;&lt;LI&gt;I would then like to iterate over the next 3 files and reprocess them just in case there was an issue to the processing the previous day.&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My main issues are how to grab only the last 4 files based on recency and then processing the files by date using a mask on their names as they also have a date. I think I would need to have a logic that is able to store the filenames date and compare it to a global variable whose date gets updated daily and is saved as a context variable and then compare and run the job if they match. Any help would be super appreciated as I am very new to this amazing tool.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you all.&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 00:16:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-retrieve-the-last-8-files-from-F/m-p/2337080#M105458</guid>
      <dc:creator>Nawaz26893</dc:creator>
      <dc:date>2024-11-16T00:16:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to retrieve the last 8 files from F</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-retrieve-the-last-8-files-from-F/m-p/2337081#M105459</link>
      <description>&lt;P&gt;Hello, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For the current date, you can use function TalendDate.getCurrentDate() that you will store in a global variable.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;By using components tFTPFileList with a link type "Iterate", you can access all files name by using the global variable &lt;B&gt;CURRENT_FILE&lt;/B&gt; (created automatically by the compoent tFTPFileList). &lt;/P&gt;&lt;P&gt;Then you can filter using a tFilter one this filename by comparing the global var that contain current date and the date in the name of the file.&lt;/P&gt;&lt;P&gt;Of course you have to transform each date (current date and file date) to the good format to be sure that the comparision will be ok.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You will have something like : &lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;tFTPFileList -&amp;gt; (iterate) tFixedFlowInput with one column = CURRENT_FILE globalVar -&amp;gt; tFilter -&amp;gt; your list of 4 files. &lt;/P&gt;</description>
      <pubDate>Mon, 12 Apr 2021 15:58:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-retrieve-the-last-8-files-from-F/m-p/2337081#M105459</guid>
      <dc:creator>MS5</dc:creator>
      <dc:date>2021-04-12T15:58:28Z</dc:date>
    </item>
  </channel>
</rss>

