<?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: Read files from FTP and get date created/modified in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/Read-files-from-FTP-and-get-date-created-modified/m-p/2266526#M45716</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Without correct file naming like myfile_25_09_2019, I think you won't be able to retrieve the "creation date" of the file because this data is not retrieved by tFTPFileProperties component. BUT you really can have Job Design which allows you to process files based on their modification date.&lt;/P&gt; 
&lt;P&gt;&lt;BR /&gt;If you're interrested in, read the following. If you absolutely need to process files based on creation date, try your own logic with tJava / Routines etc.. and your favorite FTP library.&lt;BR /&gt;&lt;BR /&gt;Even if the topic is old, someday the following could help someone else. This is my solution to your problem :&lt;/P&gt; 
&lt;P&gt;The Job design :&lt;BR /&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JOB" style="width: 999px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M5gu.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/130504iC4759374008EB723/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M5gu.png" alt="0683p000009M5gu.png" /&gt;&lt;/span&gt;&lt;SPAN class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;JOB&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt; 
&lt;P&gt;&lt;STRONG&gt;1. Get the files list with tFTPFileList component.&lt;/STRONG&gt;&lt;/P&gt; 
&lt;P&gt;Then, in the iterate loop :&lt;BR /&gt;&lt;STRONG&gt;1. Get File properties with tFTPFileProperties component.&lt;/STRONG&gt;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Get Files Properties" style="width: 825px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M7nF.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/145088i94B0AB0E134CAA6D/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M7nF.png" alt="0683p000009M7nF.png" /&gt;&lt;/span&gt;&lt;SPAN class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Get Files Properties&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&lt;BR /&gt;&lt;STRONG&gt;2. Filter the rows that doesn't have any value for "mtime" property&lt;/STRONG&gt;.&lt;/P&gt; 
&lt;P&gt;"mtime" is the unix timestamp of the file last modification. Rows without mtime are corresponding to folders, and we are looking for files. To achieve this, just use a tFilter Row component with condition : AND | "mtime" column | Empty action | non equals to operator | null value. This will only keep rows with mtime values.&lt;/P&gt; 
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Filter Rows That Doesn&amp;amp;#39;t have mtime value" style="width: 845px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M7nK.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/129080i8C6A850CEF18CA4D/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M7nK.png" alt="0683p000009M7nK.png" /&gt;&lt;/span&gt;&lt;SPAN class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Filter Rows That Doesn't have mtime value&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&lt;BR /&gt;&lt;STRONG&gt;3. With a tJava, just add another field : "fileDay", this new field will be used in the next component.&lt;/STRONG&gt;&lt;BR /&gt;I recommand using the simple Calendar Java 8 API which allows to init a Calendar from unix long ( = mtime field).&amp;nbsp;&lt;BR /&gt;We will compare file's date and today's date by using respective Calendar.DAY_OF_YEAR values.&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Pass in output_row every input_row values.&lt;/P&gt; 
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="add new field to each row : fileDay" style="width: 888px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M7nP.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/143707i37604E5889B07DDD/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M7nP.png" alt="0683p000009M7nP.png" /&gt;&lt;/span&gt;&lt;SPAN class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;add new field to each row : fileDay&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&lt;BR /&gt;&lt;STRONG&gt;4. Compare each rows "fileDay" value with today's DAY_OF_YEAR value in a tMap component&lt;BR /&gt;&lt;/STRONG&gt;I recommand again Calendar API. Please check Catch Reject input for the second output of the tMap.&amp;nbsp;&lt;BR /&gt;Then, you will have two outputs, one with files updated today, and the others...&lt;/P&gt; 
&lt;P&gt;If fileDay == today ==&amp;gt; go in the output &lt;EM&gt;filesToday&lt;/EM&gt; , else go in the catch output : &lt;EM&gt;filesNotToday&lt;/EM&gt;&lt;BR /&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="compare fileDay to todayDay in a Tmap" style="width: 848px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M7nU.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/156467iDB08AA0A66695E55/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M7nU.png" alt="0683p000009M7nU.png" /&gt;&lt;/span&gt;&lt;SPAN class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;compare fileDay to todayDay in a Tmap&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;And this is it. Now you will be able to process files updated today or not.&lt;BR /&gt;&lt;BR /&gt;Have a nice day.&lt;/P&gt;&lt;BR /&gt;&lt;A href="https://community.qlik.com/legacyfs/online/tlnd_dw_files/0683p000009Lwug"&gt;1_get_file_properties.PNG&lt;/A&gt;&lt;BR /&gt;&lt;A href="https://community.qlik.com/legacyfs/online/tlnd_dw_files/0683p000009Lwkw"&gt;2_remove_rows_with_null_mtime.PNG&lt;/A&gt;&lt;BR /&gt;&lt;A href="https://community.qlik.com/legacyfs/online/tlnd_dw_files/0683p000009Lwuq"&gt;3_add_dayOfYear_property_to_rows.PNG&lt;/A&gt;&lt;BR /&gt;&lt;A href="https://community.qlik.com/legacyfs/online/tlnd_dw_files/0683p000009Lwsb"&gt;4_compare_rows_date_to_todays_date.PNG&lt;/A&gt;&lt;BR /&gt;&lt;A href="https://community.qlik.com/legacyfs/online/tlnd_dw_files/0683p000009Lwv0"&gt;job.PNG&lt;/A&gt;</description>
    <pubDate>Tue, 01 Oct 2019 11:01:59 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2019-10-01T11:01:59Z</dc:date>
    <item>
      <title>Read files from FTP and get date created/modified</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Read-files-from-FTP-and-get-date-created-modified/m-p/2266524#M45714</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;I am new to Talend, but I have been trying to find a solution to this problem. Currently, I can list all of the files on my FTP server. I would like to be able to list all files on the server that were created on today's date. I have tried looping over all of the files on the server, and then passing the filename (I have tried current_filepath &amp;amp; current_file) to the tFTPFileProperties which would then output the properties. At this current state, the output is just null for every field.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Is there a step that I am missing somewhere?&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Also, which component from the palette would I need to use in order to only output the files that were created on today's date?&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Thanks!&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.PNG" style="width: 616px;"&gt;&lt;IMG src="https://yutwg22796.i.lithium.com/t5/image/serverpage/image-id/13258i5BD53A4D6802E6B7/image-size/large?v=1.0&amp;amp;px=999" title="Capture.PNG" alt="Capture.PNG" /&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture1.PNG" style="width: 579px;"&gt;&lt;IMG src="https://yutwg22796.i.lithium.com/t5/image/serverpage/image-id/13259iD4D0AF35BD63EAB5/image-dimensions/579x438?v=1.0" width="579" height="438" title="Capture1.PNG" alt="Capture1.PNG" /&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 17 Oct 2018 20:26:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Read-files-from-FTP-and-get-date-created-modified/m-p/2266524#M45714</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-10-17T20:26:00Z</dc:date>
    </item>
    <item>
      <title>Re: Read files from FTP and get date created/modified</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Read-files-from-FTP-and-get-date-created-modified/m-p/2266525#M45715</link>
      <description>&lt;P&gt;Hello, Is this possible to do in Talend, or am I going about it the wrong way? Also...where does everyone find tutorials/documentation on Talend? On Talend's website?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 22 Oct 2018 17:01:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Read-files-from-FTP-and-get-date-created-modified/m-p/2266525#M45715</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-10-22T17:01:59Z</dc:date>
    </item>
    <item>
      <title>Re: Read files from FTP and get date created/modified</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Read-files-from-FTP-and-get-date-created-modified/m-p/2266526#M45716</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Without correct file naming like myfile_25_09_2019, I think you won't be able to retrieve the "creation date" of the file because this data is not retrieved by tFTPFileProperties component. BUT you really can have Job Design which allows you to process files based on their modification date.&lt;/P&gt; 
&lt;P&gt;&lt;BR /&gt;If you're interrested in, read the following. If you absolutely need to process files based on creation date, try your own logic with tJava / Routines etc.. and your favorite FTP library.&lt;BR /&gt;&lt;BR /&gt;Even if the topic is old, someday the following could help someone else. This is my solution to your problem :&lt;/P&gt; 
&lt;P&gt;The Job design :&lt;BR /&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JOB" style="width: 999px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M5gu.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/130504iC4759374008EB723/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M5gu.png" alt="0683p000009M5gu.png" /&gt;&lt;/span&gt;&lt;SPAN class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;JOB&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt; 
&lt;P&gt;&lt;STRONG&gt;1. Get the files list with tFTPFileList component.&lt;/STRONG&gt;&lt;/P&gt; 
&lt;P&gt;Then, in the iterate loop :&lt;BR /&gt;&lt;STRONG&gt;1. Get File properties with tFTPFileProperties component.&lt;/STRONG&gt;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Get Files Properties" style="width: 825px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M7nF.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/145088i94B0AB0E134CAA6D/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M7nF.png" alt="0683p000009M7nF.png" /&gt;&lt;/span&gt;&lt;SPAN class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Get Files Properties&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&lt;BR /&gt;&lt;STRONG&gt;2. Filter the rows that doesn't have any value for "mtime" property&lt;/STRONG&gt;.&lt;/P&gt; 
&lt;P&gt;"mtime" is the unix timestamp of the file last modification. Rows without mtime are corresponding to folders, and we are looking for files. To achieve this, just use a tFilter Row component with condition : AND | "mtime" column | Empty action | non equals to operator | null value. This will only keep rows with mtime values.&lt;/P&gt; 
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Filter Rows That Doesn&amp;amp;#39;t have mtime value" style="width: 845px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M7nK.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/129080i8C6A850CEF18CA4D/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M7nK.png" alt="0683p000009M7nK.png" /&gt;&lt;/span&gt;&lt;SPAN class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Filter Rows That Doesn't have mtime value&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&lt;BR /&gt;&lt;STRONG&gt;3. With a tJava, just add another field : "fileDay", this new field will be used in the next component.&lt;/STRONG&gt;&lt;BR /&gt;I recommand using the simple Calendar Java 8 API which allows to init a Calendar from unix long ( = mtime field).&amp;nbsp;&lt;BR /&gt;We will compare file's date and today's date by using respective Calendar.DAY_OF_YEAR values.&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Pass in output_row every input_row values.&lt;/P&gt; 
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="add new field to each row : fileDay" style="width: 888px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M7nP.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/143707i37604E5889B07DDD/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M7nP.png" alt="0683p000009M7nP.png" /&gt;&lt;/span&gt;&lt;SPAN class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;add new field to each row : fileDay&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&lt;BR /&gt;&lt;STRONG&gt;4. Compare each rows "fileDay" value with today's DAY_OF_YEAR value in a tMap component&lt;BR /&gt;&lt;/STRONG&gt;I recommand again Calendar API. Please check Catch Reject input for the second output of the tMap.&amp;nbsp;&lt;BR /&gt;Then, you will have two outputs, one with files updated today, and the others...&lt;/P&gt; 
&lt;P&gt;If fileDay == today ==&amp;gt; go in the output &lt;EM&gt;filesToday&lt;/EM&gt; , else go in the catch output : &lt;EM&gt;filesNotToday&lt;/EM&gt;&lt;BR /&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="compare fileDay to todayDay in a Tmap" style="width: 848px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M7nU.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/156467iDB08AA0A66695E55/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M7nU.png" alt="0683p000009M7nU.png" /&gt;&lt;/span&gt;&lt;SPAN class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;compare fileDay to todayDay in a Tmap&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;And this is it. Now you will be able to process files updated today or not.&lt;BR /&gt;&lt;BR /&gt;Have a nice day.&lt;/P&gt;&lt;BR /&gt;&lt;A href="https://community.qlik.com/legacyfs/online/tlnd_dw_files/0683p000009Lwug"&gt;1_get_file_properties.PNG&lt;/A&gt;&lt;BR /&gt;&lt;A href="https://community.qlik.com/legacyfs/online/tlnd_dw_files/0683p000009Lwkw"&gt;2_remove_rows_with_null_mtime.PNG&lt;/A&gt;&lt;BR /&gt;&lt;A href="https://community.qlik.com/legacyfs/online/tlnd_dw_files/0683p000009Lwuq"&gt;3_add_dayOfYear_property_to_rows.PNG&lt;/A&gt;&lt;BR /&gt;&lt;A href="https://community.qlik.com/legacyfs/online/tlnd_dw_files/0683p000009Lwsb"&gt;4_compare_rows_date_to_todays_date.PNG&lt;/A&gt;&lt;BR /&gt;&lt;A href="https://community.qlik.com/legacyfs/online/tlnd_dw_files/0683p000009Lwv0"&gt;job.PNG&lt;/A&gt;</description>
      <pubDate>Tue, 01 Oct 2019 11:01:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Read-files-from-FTP-and-get-date-created-modified/m-p/2266526#M45716</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-10-01T11:01:59Z</dc:date>
    </item>
  </channel>
</rss>

