<?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 Iterating file in FTP directories using tLoop in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/Iterating-file-in-FTP-directories-using-tLoop/m-p/2367800#M131139</link>
    <description>Hi all, 
&lt;BR /&gt;Im a newbie in Talend Open Studio. 
&lt;BR /&gt;I want to iterate all files in the numbers of FTP directories, about more than 500 directories, then process those all files with another subjob. The name of directories are defined and set as global variable as array. 
&lt;BR /&gt;Here my SubJob : 
&lt;BR /&gt;tFTPConnection---On Subjob Ok--&amp;gt;tSetGlobalVar---On Subjob Ok--&amp;gt;tJava_1---On Sunjob Ok--&amp;gt;tLoop--iterate---&amp;gt;tFTPFilelist--iterate--&amp;gt;tJava_2 
&lt;BR /&gt;my Setting 
&lt;BR /&gt;1. tSetGlobalVar: 
&lt;BR /&gt;key=dir, value=new java.util.ArrayList&amp;lt;String&amp;gt;() 
&lt;BR /&gt;2. tJava_1 
&lt;BR /&gt;List&amp;lt;String&amp;gt; dir = (List&amp;lt;String&amp;gt;)globalMap.get("dir"); 
&lt;BR /&gt;dir.add("bps1100"); 
&lt;BR /&gt;dir.add("bps1200"); 
&lt;BR /&gt;dir.add("bps1300"); 
&lt;BR /&gt;dir.add("bps1400"); 
&lt;BR /&gt;...... 
&lt;BR /&gt;3. tLoop 
&lt;BR /&gt;for , from=0,to=((List&amp;lt;String&amp;gt;)globalMap.get("dir")).size()-1,step=1 
&lt;BR /&gt;4. tFTPFilelist 
&lt;BR /&gt;remote dir= "/shped/"+((List&amp;lt;String&amp;gt;)globalMap.get("dir")).get(((Integer)globalMap.get("tLoop_1_CURRENT_VALUE"))) 
&lt;BR /&gt;5. tJava_2 to check the list of files 
&lt;BR /&gt;System.out.println(((String)globalMap.get("tFTPFileList_1_CURRENT_FILEPATH"))); 
&lt;BR /&gt;Problem : 
&lt;BR /&gt;- iteration only work at first directory, and stop execution with error in the next directory, this is error message: 
&lt;BR /&gt;Exception in component tFTPFileList_1 
&lt;BR /&gt;2: No such file 
&lt;BR /&gt; at com.jcraft.jsch.ChannelSftp.throwStatusError(ChannelSftp.java:2287) 
&lt;BR /&gt; at com.jcraft.jsch.ChannelSftp._stat(ChannelSftp.java:1740) 
&lt;BR /&gt; at com.jcraft.jsch.ChannelSftp._stat(ChannelSftp.java:1757) 
&lt;BR /&gt; at com.jcraft.jsch.ChannelSftp.ls(ChannelSftp.java:1195) 
&lt;BR /&gt; at shped.test3_0_1.test3.tLoop_1Process(test3.java:1310) 
&lt;BR /&gt; at shped.test3_0_1.test3.tJava_1Process(test3.java:1198) 
&lt;BR /&gt; at shped.test3_0_1.test3.tSetGlobalVar_1Process(test3.java:579) 
&lt;BR /&gt; at shped.test3_0_1.test3.tFTPConnection_1Process(test3.java:489) 
&lt;BR /&gt;Anything wrong? How then I can recovered this? 
&lt;BR /&gt; 
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009ME4G.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/139102iE7397CB04EF7F61F/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009ME4G.png" alt="0683p000009ME4G.png" /&gt;&lt;/span&gt;</description>
    <pubDate>Fri, 12 Apr 2013 10:27:52 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2013-04-12T10:27:52Z</dc:date>
    <item>
      <title>Iterating file in FTP directories using tLoop</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Iterating-file-in-FTP-directories-using-tLoop/m-p/2367800#M131139</link>
      <description>Hi all, 
&lt;BR /&gt;Im a newbie in Talend Open Studio. 
&lt;BR /&gt;I want to iterate all files in the numbers of FTP directories, about more than 500 directories, then process those all files with another subjob. The name of directories are defined and set as global variable as array. 
&lt;BR /&gt;Here my SubJob : 
&lt;BR /&gt;tFTPConnection---On Subjob Ok--&amp;gt;tSetGlobalVar---On Subjob Ok--&amp;gt;tJava_1---On Sunjob Ok--&amp;gt;tLoop--iterate---&amp;gt;tFTPFilelist--iterate--&amp;gt;tJava_2 
&lt;BR /&gt;my Setting 
&lt;BR /&gt;1. tSetGlobalVar: 
&lt;BR /&gt;key=dir, value=new java.util.ArrayList&amp;lt;String&amp;gt;() 
&lt;BR /&gt;2. tJava_1 
&lt;BR /&gt;List&amp;lt;String&amp;gt; dir = (List&amp;lt;String&amp;gt;)globalMap.get("dir"); 
&lt;BR /&gt;dir.add("bps1100"); 
&lt;BR /&gt;dir.add("bps1200"); 
&lt;BR /&gt;dir.add("bps1300"); 
&lt;BR /&gt;dir.add("bps1400"); 
&lt;BR /&gt;...... 
&lt;BR /&gt;3. tLoop 
&lt;BR /&gt;for , from=0,to=((List&amp;lt;String&amp;gt;)globalMap.get("dir")).size()-1,step=1 
&lt;BR /&gt;4. tFTPFilelist 
&lt;BR /&gt;remote dir= "/shped/"+((List&amp;lt;String&amp;gt;)globalMap.get("dir")).get(((Integer)globalMap.get("tLoop_1_CURRENT_VALUE"))) 
&lt;BR /&gt;5. tJava_2 to check the list of files 
&lt;BR /&gt;System.out.println(((String)globalMap.get("tFTPFileList_1_CURRENT_FILEPATH"))); 
&lt;BR /&gt;Problem : 
&lt;BR /&gt;- iteration only work at first directory, and stop execution with error in the next directory, this is error message: 
&lt;BR /&gt;Exception in component tFTPFileList_1 
&lt;BR /&gt;2: No such file 
&lt;BR /&gt; at com.jcraft.jsch.ChannelSftp.throwStatusError(ChannelSftp.java:2287) 
&lt;BR /&gt; at com.jcraft.jsch.ChannelSftp._stat(ChannelSftp.java:1740) 
&lt;BR /&gt; at com.jcraft.jsch.ChannelSftp._stat(ChannelSftp.java:1757) 
&lt;BR /&gt; at com.jcraft.jsch.ChannelSftp.ls(ChannelSftp.java:1195) 
&lt;BR /&gt; at shped.test3_0_1.test3.tLoop_1Process(test3.java:1310) 
&lt;BR /&gt; at shped.test3_0_1.test3.tJava_1Process(test3.java:1198) 
&lt;BR /&gt; at shped.test3_0_1.test3.tSetGlobalVar_1Process(test3.java:579) 
&lt;BR /&gt; at shped.test3_0_1.test3.tFTPConnection_1Process(test3.java:489) 
&lt;BR /&gt;Anything wrong? How then I can recovered this? 
&lt;BR /&gt; 
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009ME4G.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/139102iE7397CB04EF7F61F/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009ME4G.png" alt="0683p000009ME4G.png" /&gt;&lt;/span&gt;</description>
      <pubDate>Fri, 12 Apr 2013 10:27:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Iterating-file-in-FTP-directories-using-tLoop/m-p/2367800#M131139</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-04-12T10:27:52Z</dc:date>
    </item>
    <item>
      <title>Re: Iterating file in FTP directories using tLoop</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Iterating-file-in-FTP-directories-using-tLoop/m-p/2367801#M131140</link>
      <description>Hi
&lt;BR /&gt;tForeach component is the best component to complete your request, you can use tForeach to replace tSetglobalvar tjava tloop components in the job, please read its user manual on Talend Help Center.
&lt;BR /&gt;
&lt;A href="https://help.talend.com/search/all?query=tForeach&amp;amp;content-lang=en" rel="nofollow noopener noreferrer"&gt;https://help.talend.com/search/all?query=tForeach&amp;amp;content-lang=en&lt;/A&gt;
&lt;BR /&gt;Shong</description>
      <pubDate>Sat, 13 Apr 2013 11:37:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Iterating-file-in-FTP-directories-using-tLoop/m-p/2367801#M131140</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-04-13T11:37:04Z</dc:date>
    </item>
  </channel>
</rss>

