<?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: Copy most recent file from one directory to another in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/Copy-most-recent-file-from-one-directory-to-another/m-p/2274725#M51315</link>
    <description>Hi, 
&lt;BR /&gt;Did you try tFileList ordered by modification date desc tFileProperties (mtime and mtime_string fields give you the last modification date and time). You may also decide to break the iterate loop or jump over the undesired rows (see this post&amp;nbsp; 
&lt;A href="https://community.qlik.com/s/feed/0D53p00007vCp3WCAS" target="_blank" rel="nofollow noopener noreferrer"&gt;https://community.talend.com/t5/Design-and-Development/Break-From-Iteration/td-p/99207&lt;/A&gt;). 
&lt;BR /&gt;Regards, 
&lt;BR /&gt;TRF</description>
    <pubDate>Mon, 06 Mar 2017 13:27:37 GMT</pubDate>
    <dc:creator>TRF</dc:creator>
    <dc:date>2017-03-06T13:27:37Z</dc:date>
    <item>
      <title>Copy most recent file from one directory to another</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Copy-most-recent-file-from-one-directory-to-another/m-p/2274724#M51314</link>
      <description>Hi everyone. 
&lt;BR /&gt;I am trying to build a job in open studio that copies a .txt file from one location to another location. There will be a number of .txt files in the directory, but I only want to copy across the most recent one. 
&lt;BR /&gt;for example&amp;nbsp; 
&lt;BR /&gt;file1.txt 
&lt;BR /&gt;file2.txt 
&lt;BR /&gt;file3.txt 
&lt;BR /&gt;I am trying to do this based on the date modified properties. 
&lt;BR /&gt;I have looked through a few posts on here but have not managed to get any solution to work. 
&lt;BR /&gt;Would anyone be able to point me in the right direction, or even better if you have any print screen examples I could follow? 
&lt;BR /&gt;Many thanks in advance!</description>
      <pubDate>Mon, 06 Mar 2017 12:03:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Copy-most-recent-file-from-one-directory-to-another/m-p/2274724#M51314</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-03-06T12:03:44Z</dc:date>
    </item>
    <item>
      <title>Re: Copy most recent file from one directory to another</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Copy-most-recent-file-from-one-directory-to-another/m-p/2274725#M51315</link>
      <description>Hi, 
&lt;BR /&gt;Did you try tFileList ordered by modification date desc tFileProperties (mtime and mtime_string fields give you the last modification date and time). You may also decide to break the iterate loop or jump over the undesired rows (see this post&amp;nbsp; 
&lt;A href="https://community.qlik.com/s/feed/0D53p00007vCp3WCAS" target="_blank" rel="nofollow noopener noreferrer"&gt;https://community.talend.com/t5/Design-and-Development/Break-From-Iteration/td-p/99207&lt;/A&gt;). 
&lt;BR /&gt;Regards, 
&lt;BR /&gt;TRF</description>
      <pubDate>Mon, 06 Mar 2017 13:27:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Copy-most-recent-file-from-one-directory-to-another/m-p/2274725#M51315</guid>
      <dc:creator>TRF</dc:creator>
      <dc:date>2017-03-06T13:27:37Z</dc:date>
    </item>
    <item>
      <title>Re: Copy most recent file from one directory to another</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Copy-most-recent-file-from-one-directory-to-another/m-p/2274726#M51316</link>
      <description>I have tried the solution in the attached image. 
&lt;BR /&gt;I keep getting mtime = null in the tlog though. I am clearly doing something wrong? 
&lt;BR /&gt; 
&lt;BR /&gt; 
&lt;A href="https://community.talend.com/legacyfs/online/membersTempo/419086/Null.png" target="_blank"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MDZt.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/141477i659F99FB3B8A209E/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MDZt.png" alt="0683p000009MDZt.png" /&gt;&lt;/span&gt;&lt;/A&gt;</description>
      <pubDate>Mon, 06 Mar 2017 13:42:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Copy-most-recent-file-from-one-directory-to-another/m-p/2274726#M51316</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-03-06T13:42:30Z</dc:date>
    </item>
    <item>
      <title>Re: Copy most recent file from one directory to another</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Copy-most-recent-file-from-one-directory-to-another/m-p/2274727#M51317</link>
      <description>Use "((String)globalMap.get("tFileList_2_CURRENT_FILEPATH"))" in tFileProperties and put a tLogRow just after this component.
&lt;BR /&gt;I've just tested on my environment. It works like a charme.
&lt;BR /&gt;
&lt;PRE&gt;.---------------------------------------------------------------------+------------------------------------------------+--------------------+-----------+----+-------------+----------------------------.&lt;BR /&gt;|                                                                                               tLogRow_1                                                                                               |&lt;BR /&gt;|=--------------------------------------------------------------------+------------------------------------------------+--------------------+-----------+----+-------------+---------------------------=|&lt;BR /&gt;|abs_path                                                             |dirname                                         |basename            |mode_string|size|mtime        |mtime_string                |&lt;BR /&gt;|=--------------------------------------------------------------------+------------------------------------------------+--------------------+-----------+----+-------------+---------------------------=|&lt;BR /&gt;|xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx0170301.csv|xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx|xxxxxxxx20170301.csv|rw         |103 |1488442149885|Thu Mar 02 09:09:09 CET 2017|&lt;BR /&gt;'---------------------------------------------------------------------+------------------------------------------------+--------------------+-----------+----+-------------+----------------------------'&lt;BR /&gt;&lt;/PRE&gt;
&lt;BR /&gt;
&lt;BR /&gt;Regards,
&lt;BR /&gt;TRF</description>
      <pubDate>Mon, 06 Mar 2017 14:21:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Copy-most-recent-file-from-one-directory-to-another/m-p/2274727#M51317</guid>
      <dc:creator>TRF</dc:creator>
      <dc:date>2017-03-06T14:21:35Z</dc:date>
    </item>
    <item>
      <title>Re: Copy most recent file from one directory to another</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Copy-most-recent-file-from-one-directory-to-another/m-p/2274728#M51318</link>
      <description>Yes, This is working and it is now writing the most recent file properties to a tlog, which is great.
&lt;BR /&gt;How do I use those details in the tlog to then copy the file across to a new location?</description>
      <pubDate>Mon, 06 Mar 2017 15:10:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Copy-most-recent-file-from-one-directory-to-another/m-p/2274728#M51318</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-03-06T15:10:18Z</dc:date>
    </item>
    <item>
      <title>Re: Copy most recent file from one directory to another</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Copy-most-recent-file-from-one-directory-to-another/m-p/2274729#M51319</link>
      <description>Just have to configure a tFileCopy with the required informations</description>
      <pubDate>Mon, 06 Mar 2017 16:56:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Copy-most-recent-file-from-one-directory-to-another/m-p/2274729#M51319</guid>
      <dc:creator>TRF</dc:creator>
      <dc:date>2017-03-06T16:56:34Z</dc:date>
    </item>
    <item>
      <title>Re: Copy most recent file from one directory to another</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Copy-most-recent-file-from-one-directory-to-another/m-p/2274730#M51320</link>
      <description>Thank you TRF. 
&lt;BR /&gt;This is the part I am struggling with. The tlogrow only has a error message or a number of lines option to feed into the tfilecopy. Using the current filepath from the tfilelist only copies across the first file it comes to in the original directory and not the most recent file. 
&lt;BR /&gt;Apologies if this is an easy task, I have only recently picked up talend again and I am trying to get up to speed. 
&lt;BR /&gt;Regards,</description>
      <pubDate>Tue, 07 Mar 2017 08:26:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Copy-most-recent-file-from-one-directory-to-another/m-p/2274730#M51320</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-03-07T08:26:20Z</dc:date>
    </item>
    <item>
      <title>Re: Copy most recent file from one directory to another</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Copy-most-recent-file-from-one-directory-to-another/m-p/2274731#M51321</link>
      <description>Hi,&lt;BR /&gt;This is not normal to have only 1 field except if tBufferInput_1 schema is not aligned.&lt;BR /&gt;Did you check it?</description>
      <pubDate>Tue, 07 Mar 2017 10:09:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Copy-most-recent-file-from-one-directory-to-another/m-p/2274731#M51321</guid>
      <dc:creator>TRF</dc:creator>
      <dc:date>2017-03-07T10:09:24Z</dc:date>
    </item>
    <item>
      <title>Re: Copy most recent file from one directory to another</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Copy-most-recent-file-from-one-directory-to-another/m-p/2274732#M51322</link>
      <description>Apologies I did make some changes to the job as I was not getting the tbuffer to work. 
&lt;BR /&gt;This is a print screen of my job. Up to the tlogrow everything appears to work as expected in that it outputs the file properties of the most recent file to the tlogrow. 
&lt;BR /&gt;You can see the options I have on the left in terms of what to use in the tfilecopy. 
&lt;BR /&gt; 
&lt;A href="https://community.talend.com/legacyfs/online/membersTempo/419086/filecopy.png" target="_blank"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MDW7.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/136792i97B0CEA3AE383E35/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MDW7.png" alt="0683p000009MDW7.png" /&gt;&lt;/span&gt; &lt;/A&gt;</description>
      <pubDate>Tue, 07 Mar 2017 10:49:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Copy-most-recent-file-from-one-directory-to-another/m-p/2274732#M51322</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-03-07T10:49:38Z</dc:date>
    </item>
    <item>
      <title>Re: Copy most recent file from one directory to another</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Copy-most-recent-file-from-one-directory-to-another/m-p/2274733#M51323</link>
      <description>OK, it doesn't work like this.&lt;BR /&gt;Click on tLogRow then edit schema. Here are the available fields.&lt;BR /&gt;So in tFileCopy, you can use abs_path to indicate which file you want to copy.</description>
      <pubDate>Tue, 07 Mar 2017 11:30:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Copy-most-recent-file-from-one-directory-to-another/m-p/2274733#M51323</guid>
      <dc:creator>TRF</dc:creator>
      <dc:date>2017-03-07T11:30:37Z</dc:date>
    </item>
    <item>
      <title>Re: Copy most recent file from one directory to another</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Copy-most-recent-file-from-one-directory-to-another/m-p/2274734#M51324</link>
      <description>Thanks again for your response.
&lt;BR /&gt;I can see the abs_path in the schema of the tlogrow, but how do I use that in the tfilecopy to indicate the file to use?</description>
      <pubDate>Tue, 07 Mar 2017 11:44:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Copy-most-recent-file-from-one-directory-to-another/m-p/2274734#M51324</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-03-07T11:44:07Z</dc:date>
    </item>
    <item>
      <title>Re: Copy most recent file from one directory to another</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Copy-most-recent-file-from-one-directory-to-another/m-p/2274735#M51325</link>
      <description>Well, for tFileCopy try row7.abs_path.&lt;BR /&gt;Should work.</description>
      <pubDate>Tue, 07 Mar 2017 13:08:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Copy-most-recent-file-from-one-directory-to-another/m-p/2274735#M51325</guid>
      <dc:creator>TRF</dc:creator>
      <dc:date>2017-03-07T13:08:59Z</dc:date>
    </item>
    <item>
      <title>Re: Copy most recent file from one directory to another</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Copy-most-recent-file-from-one-directory-to-another/m-p/2274736#M51326</link>
      <description>You my friend are an absolute star!&lt;BR /&gt;Do you happen to have any guidance to explain the row7 part? It is working like a charm.&lt;BR /&gt;Many thanks!</description>
      <pubDate>Tue, 07 Mar 2017 13:50:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Copy-most-recent-file-from-one-directory-to-another/m-p/2274736#M51326</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-03-07T13:50:07Z</dc:date>
    </item>
    <item>
      <title>Re: Copy most recent file from one directory to another</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Copy-most-recent-file-from-one-directory-to-another/m-p/2274737#M51327</link>
      <description>Thank's Richard, it's a pleasure for me to help people as often as I can.&lt;BR /&gt;If you click the red arrow after tLogRow (row7), details are displayed on the component tab.&lt;BR /&gt;Just refere to flowname.fieldname to use them as soon as they have a value.&lt;BR /&gt;Carefull, if you refere to flowname.fieldname&amp;nbsp;in a subjob after the one where this flow is defined, you'll get the las value for this field.&lt;BR /&gt;Regards,&lt;BR /&gt;TRF</description>
      <pubDate>Tue, 07 Mar 2017 14:08:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Copy-most-recent-file-from-one-directory-to-another/m-p/2274737#M51327</guid>
      <dc:creator>TRF</dc:creator>
      <dc:date>2017-03-07T14:08:33Z</dc:date>
    </item>
    <item>
      <title>Re: Copy most recent file from one directory to another</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Copy-most-recent-file-from-one-directory-to-another/m-p/2274738#M51328</link>
      <description>Great, very helpful!</description>
      <pubDate>Tue, 07 Mar 2017 14:30:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Copy-most-recent-file-from-one-directory-to-another/m-p/2274738#M51328</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-03-07T14:30:43Z</dc:date>
    </item>
  </channel>
</rss>

