<?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: generating multiple excel files in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/generating-multiple-excel-files/m-p/2376406#M138591</link>
    <description>Hi, 
&lt;BR /&gt;How about spliting a file in several rows? 
&lt;BR /&gt;Here is an option 'Split output in several files' in the advanced setting tab of tFileOutputDelimited. You can generate N rows in each file. 
&lt;BR /&gt;Could you please take a look at a forum: 
&lt;A href="https://community.qlik.com/s/feed/0D53p00007vCohLCAS" target="_blank" rel="nofollow noopener noreferrer"&gt;https://community.talend.com/t5/Design-and-Development/resolved-split-large-excel-file-to-2-or-more-excel-files/td-p/96435&lt;/A&gt; to see if it is satisfying your need. 
&lt;BR /&gt;Best regards 
&lt;BR /&gt;Sabrina</description>
    <pubDate>Wed, 08 Jul 2015 04:23:56 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2015-07-08T04:23:56Z</dc:date>
    <item>
      <title>generating multiple excel files</title>
      <link>https://community.qlik.com/t5/Talend-Studio/generating-multiple-excel-files/m-p/2376405#M138590</link>
      <description>Hi, 
&lt;BR /&gt;I need to export a db table into a xls (excel2003) file, but as my table contains more than 65535 rows, i want to generate as many excel file as needed to not be blocked by the excel sheet rows limit. 
&lt;BR /&gt;I know i could use xlsx file (excel2007) in talend to bypass this limit, but the rest of the export process accept only xls file, so i can't use xlsx... 
&lt;BR /&gt;I made a job like this : 
&lt;BR /&gt;tDBInput --&amp;gt; tMap --&amp;gt; tJavaRow --&amp;gt; tFileOutputExcel 
&lt;BR /&gt;The tMap add a sequence to count the number of rows extracted from the table and output a field (named "seq") with this expression : 
&lt;BR /&gt;DataOperation.FIX(Var.seq/65000)+1 
&lt;BR /&gt;Where Var.seq is simply a&amp;nbsp;Numeric.sequence("s1",1,1)&amp;nbsp; 
&lt;BR /&gt;This field is use in the tJavaRow to produce : 
&lt;BR /&gt;globalMap.put("filename_no", new java.io.FileOutputStream("filename_"+input_row.seq+".xls",false)); 
&lt;BR /&gt;and i set my tFileOutputExcel to use outputStream like this : 
&lt;BR /&gt;(java.io.OutputStream)globalMap.get("filename_no") 
&lt;BR /&gt;When i launch my job, it create a first file named "filename_1.xls", and i can see that when the read pass the 65000 rows, a second file named "filename_2.xls" is created, but the first file is empty and when the read reach the 65535 rows, the job crash due to the excel sheet limit. 
&lt;BR /&gt;Even if the wanted files are created, the component still try to write all the rows in the last file. 
&lt;BR /&gt;Can anyone tell me what i did wrong, and how i can get the component to write the bunch of 65000 rows in the correspondant file ? 
&lt;BR /&gt;Thanks</description>
      <pubDate>Tue, 07 Jul 2015 17:23:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/generating-multiple-excel-files/m-p/2376405#M138590</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-07-07T17:23:59Z</dc:date>
    </item>
    <item>
      <title>Re: generating multiple excel files</title>
      <link>https://community.qlik.com/t5/Talend-Studio/generating-multiple-excel-files/m-p/2376406#M138591</link>
      <description>Hi, 
&lt;BR /&gt;How about spliting a file in several rows? 
&lt;BR /&gt;Here is an option 'Split output in several files' in the advanced setting tab of tFileOutputDelimited. You can generate N rows in each file. 
&lt;BR /&gt;Could you please take a look at a forum: 
&lt;A href="https://community.qlik.com/s/feed/0D53p00007vCohLCAS" target="_blank" rel="nofollow noopener noreferrer"&gt;https://community.talend.com/t5/Design-and-Development/resolved-split-large-excel-file-to-2-or-more-excel-files/td-p/96435&lt;/A&gt; to see if it is satisfying your need. 
&lt;BR /&gt;Best regards 
&lt;BR /&gt;Sabrina</description>
      <pubDate>Wed, 08 Jul 2015 04:23:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/generating-multiple-excel-files/m-p/2376406#M138591</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-07-08T04:23:56Z</dc:date>
    </item>
    <item>
      <title>Re: generating multiple excel files</title>
      <link>https://community.qlik.com/t5/Talend-Studio/generating-multiple-excel-files/m-p/2376407#M138592</link>
      <description>Hi,
&lt;BR /&gt;Yes, that work, thanks Sabrina.
&lt;BR /&gt;But can't I generate directly xls files ? the job i did can't work the way i did it ?
&lt;BR /&gt;If not i'll stick with the solution you give, but i really want to understand why my job don't work, I thougt it was just a matter of component configuration...</description>
      <pubDate>Wed, 08 Jul 2015 09:12:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/generating-multiple-excel-files/m-p/2376407#M138592</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-07-08T09:12:11Z</dc:date>
    </item>
    <item>
      <title>Re: generating multiple excel files</title>
      <link>https://community.qlik.com/t5/Talend-Studio/generating-multiple-excel-files/m-p/2376408#M138593</link>
      <description>&lt;BLOCKQUOTE&gt; 
 &lt;TABLE border="1"&gt; 
  &lt;TBODY&gt; 
   &lt;TR&gt; 
    &lt;TD&gt;Hi,&lt;BR /&gt;Yes, that work, thanks Sabrina.&lt;BR /&gt;But can't I generate directly xls files ? the job i did can't work the way i did it ?&lt;BR /&gt;If not i'll stick with the solution you give, but i really want to understand why my job don't work, I thougt it was just a matter of component configuration...&lt;/TD&gt; 
   &lt;/TR&gt; 
  &lt;/TBODY&gt; 
 &lt;/TABLE&gt; 
&lt;/BLOCKQUOTE&gt; 
&lt;BR /&gt;jmarle, 
&lt;BR /&gt;I'm new to Talend Open Studio so I'm sorry that I don't have a solution for you, but you said you really want to understand why your job doesn't work, and I can give you a bit of insight on that. &amp;nbsp;I was working on a job where I wanted to perform different actions based on the incoming rows as well, and I had the same issue. &amp;nbsp;The problem is based on the type of row connections used. &amp;nbsp;You're using the Flow type of connection correct? &amp;nbsp;You're probably using the Main flow connection to connect everything, so it's using a Flow, or passing everything over to the next component at once. &amp;nbsp;So how I understand what happens is your tDBInput sends all rows to tMap at once, and your tMap does ALL of its processing and once it's done, it passes everything to tJavaRow. &amp;nbsp;Now during tJavaRow's execution, it does set the "filename_no" variable correctly I'm sure, but your issue is because tJavaRow sends all data at once to your tFileOutputExcel since it is a Flow connection. &amp;nbsp;This means that even though tJavaRow sets the variable correctly while it is executing, the global variable "filename_no" is going to be set to the value of the very last value in tJavaRow, in this case "filename_2.xls". &amp;nbsp;So when your tFileOutputExcel receives the data flow, it only sees the global variable "filename_no" is set to "filename_2" and only writes to that workbook. 
&lt;BR /&gt;Using the Row-&amp;gt;Main flow seems to always lead the following components seeing the global variables as only the very last value. &amp;nbsp;In order to get this to work, I used the tFlowToIterate component, which takes the Row-&amp;gt;Main Flow connection and turns it into a list of individual rows, where it iterates each individual row and sends that row to the next component. &amp;nbsp;So in this case the following components see the global variable EACH TIME it is set rather than only the very last value it was set to. 
&lt;BR /&gt;In your case though, I'm not sure that this would be a good option, since you have a very large amount of data. &amp;nbsp;You could definitely try it though. &amp;nbsp;Since the Output components only take the Row-&amp;gt;Main Flow type, I ended up using tFlowToIterate and then using tRowGenerator to convert that individual row to a Flow for the output. &amp;nbsp;It worked for me and I'm using tFileOutputExcel too, so it might work for you! 
&lt;BR /&gt;Thanks, 
&lt;BR /&gt;Paul</description>
      <pubDate>Tue, 12 Jan 2016 00:11:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/generating-multiple-excel-files/m-p/2376408#M138593</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-01-12T00:11:48Z</dc:date>
    </item>
  </channel>
</rss>

