<?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 Not able to iterate files in Talend Spark using tLoop in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/Not-able-to-iterate-files-in-Talend-Spark-using-tLoop/m-p/2268951#M47370</link>
    <description>&lt;P&gt;&lt;SPAN&gt;Is there a way to iterate files in Spark ? Like tfilelist . I know we can give multiple files as input in tfiledelimited input by giving wild card char "*". But my requirement is to iterate each xml file and create corresponding output file with same name. May i know if u have any suggestions on how to achieve this in spark ?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is the solution (Screenshot below) that i tried with tLoop which also not working.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In the below code,&amp;nbsp;&lt;SPAN&gt;context.FileList= concatenated list of files with ",", eg: file1,file2,file3 and so on...&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;tJava component Code ==&amp;gt;&lt;/P&gt;
&lt;P&gt;List&amp;lt;String&amp;gt; FileList = Arrays.asList(context.FileList.split(","));&lt;BR /&gt;context.FileListN = context.FileList;&lt;/P&gt;
&lt;P&gt;System.out.println("FileList --&amp;gt;"+ context.FileListN);&lt;/P&gt;
&lt;P&gt;//String FileListArray[] = context.FileList.split(",");&lt;BR /&gt;int listsize = FileList.size();&lt;BR /&gt;int i;&lt;/P&gt;
&lt;P&gt;globalMap.put("SizeofList", listsize);&lt;BR /&gt;globalMap.put("FileList", FileList);&lt;/P&gt;
&lt;P&gt;System.out.println("FileList --&amp;gt;"+ globalMap.get("FileList"));&lt;BR /&gt;System.out.println("Size of List --&amp;gt;"+ globalMap.get("SizeofList"));&lt;/P&gt;
&lt;P&gt;for(i=0;i &amp;lt; listsize; i++){&lt;BR /&gt;String filenm = ((List&amp;lt;String&amp;gt;)globalMap.get("FileList")).get(i);&lt;BR /&gt;System.out.println("Processing File --&amp;gt;"+ filenm);&lt;BR /&gt;Until_ConvertXMLtoJSON_V1.XmltoJson(context.FileDir, filenm);&lt;BR /&gt;}&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;tLoop ==&amp;gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;While loop&lt;/P&gt;
&lt;P&gt;Declaration == int i=0&lt;/P&gt;
&lt;P&gt;condition =i &amp;lt;((Integer)globalMap.get("SizeofList"))&lt;/P&gt;
&lt;P&gt;Iteration =i++&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Let me know if i am missing anything!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sat, 16 Nov 2024 07:42:01 GMT</pubDate>
    <dc:creator>pragna_k</dc:creator>
    <dc:date>2024-11-16T07:42:01Z</dc:date>
    <item>
      <title>Not able to iterate files in Talend Spark using tLoop</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Not-able-to-iterate-files-in-Talend-Spark-using-tLoop/m-p/2268951#M47370</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Is there a way to iterate files in Spark ? Like tfilelist . I know we can give multiple files as input in tfiledelimited input by giving wild card char "*". But my requirement is to iterate each xml file and create corresponding output file with same name. May i know if u have any suggestions on how to achieve this in spark ?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is the solution (Screenshot below) that i tried with tLoop which also not working.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In the below code,&amp;nbsp;&lt;SPAN&gt;context.FileList= concatenated list of files with ",", eg: file1,file2,file3 and so on...&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;tJava component Code ==&amp;gt;&lt;/P&gt;
&lt;P&gt;List&amp;lt;String&amp;gt; FileList = Arrays.asList(context.FileList.split(","));&lt;BR /&gt;context.FileListN = context.FileList;&lt;/P&gt;
&lt;P&gt;System.out.println("FileList --&amp;gt;"+ context.FileListN);&lt;/P&gt;
&lt;P&gt;//String FileListArray[] = context.FileList.split(",");&lt;BR /&gt;int listsize = FileList.size();&lt;BR /&gt;int i;&lt;/P&gt;
&lt;P&gt;globalMap.put("SizeofList", listsize);&lt;BR /&gt;globalMap.put("FileList", FileList);&lt;/P&gt;
&lt;P&gt;System.out.println("FileList --&amp;gt;"+ globalMap.get("FileList"));&lt;BR /&gt;System.out.println("Size of List --&amp;gt;"+ globalMap.get("SizeofList"));&lt;/P&gt;
&lt;P&gt;for(i=0;i &amp;lt; listsize; i++){&lt;BR /&gt;String filenm = ((List&amp;lt;String&amp;gt;)globalMap.get("FileList")).get(i);&lt;BR /&gt;System.out.println("Processing File --&amp;gt;"+ filenm);&lt;BR /&gt;Until_ConvertXMLtoJSON_V1.XmltoJson(context.FileDir, filenm);&lt;BR /&gt;}&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;tLoop ==&amp;gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;While loop&lt;/P&gt;
&lt;P&gt;Declaration == int i=0&lt;/P&gt;
&lt;P&gt;condition =i &amp;lt;((Integer)globalMap.get("SizeofList"))&lt;/P&gt;
&lt;P&gt;Iteration =i++&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Let me know if i am missing anything!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 07:42:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Not-able-to-iterate-files-in-Talend-Spark-using-tLoop/m-p/2268951#M47370</guid>
      <dc:creator>pragna_k</dc:creator>
      <dc:date>2024-11-16T07:42:01Z</dc:date>
    </item>
    <item>
      <title>Re: Not able to iterate files in Talend Spark using tLoop</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Not-able-to-iterate-files-in-Talend-Spark-using-tLoop/m-p/2268952#M47371</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;tLoop component in spark job has the same feature of the DI one, except the parallelization, which does not exist on Spark.&lt;/P&gt;
&lt;P&gt;Best regards&lt;/P&gt;
&lt;P&gt;Sabrina&lt;/P&gt;</description>
      <pubDate>Wed, 26 Sep 2018 08:56:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Not-able-to-iterate-files-in-Talend-Spark-using-tLoop/m-p/2268952#M47371</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-09-26T08:56:03Z</dc:date>
    </item>
    <item>
      <title>Re: Not able to iterate files in Talend Spark using tLoop</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Not-able-to-iterate-files-in-Talend-Spark-using-tLoop/m-p/2268953#M47372</link>
      <description>The tloop component did not work for me. Can you post a solution if u have&lt;BR /&gt;with tloop. I want same file names for input and output both.</description>
      <pubDate>Wed, 26 Sep 2018 12:53:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Not-able-to-iterate-files-in-Talend-Spark-using-tLoop/m-p/2268953#M47372</guid>
      <dc:creator>pragna_k</dc:creator>
      <dc:date>2018-09-26T12:53:21Z</dc:date>
    </item>
    <item>
      <title>Re: Not able to iterate files in Talend Spark using tLoop</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Not-able-to-iterate-files-in-Talend-Spark-using-tLoop/m-p/2268954#M47373</link>
      <description>&lt;P&gt;HI,&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Do you have any solution for the same? I have the same requirement hence the same issue .&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Thanks&lt;/P&gt; 
&lt;P&gt;BAdri Nair&amp;nbsp;&lt;/P&gt; 
&lt;BLOCKQUOTE&gt; 
 &lt;HR /&gt; 
 &lt;A href="https://community.qlik.com/s/profile/00539000004XsaeAAC"&gt;@xdshi&lt;/A&gt;&amp;nbsp;wrote: 
 &lt;BR /&gt; 
 &lt;P&gt;Hello,&lt;/P&gt; 
 &lt;P&gt;tLoop component in spark job has the same feature of the DI one, except the parallelization, which does not exist on Spark.&lt;/P&gt; 
 &lt;P&gt;Best regards&lt;/P&gt; 
 &lt;P&gt;Sabrina&lt;/P&gt; 
 &lt;HR /&gt; 
&lt;/BLOCKQUOTE&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 01 Jul 2019 11:51:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Not-able-to-iterate-files-in-Talend-Spark-using-tLoop/m-p/2268954#M47373</guid>
      <dc:creator>badri-nair</dc:creator>
      <dc:date>2019-07-01T11:51:52Z</dc:date>
    </item>
  </channel>
</rss>

