<?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: delimiter output file with increasing file name in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/delimiter-output-file-with-increasing-file-name/m-p/2295534#M68299</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;A href="https://community.qlik.com/s/profile/0053p000007LMz0AAG"&gt;@pawe84&lt;/A&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Whenever you start the job the global variables/context set earlier will be flushed.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Hence the only way is to store the job count in a file, and in the pre job read the file/Table, add one more to the job count and store to context/Global Variable and use the same context/global variable to name the file.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;After that again update the file/table with new value of the counter.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Thanks and Regards,&lt;/P&gt; 
&lt;P&gt;Subhadip&lt;/P&gt;</description>
    <pubDate>Thu, 20 Jun 2019 15:54:29 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2019-06-20T15:54:29Z</dc:date>
    <item>
      <title>delimiter output file with increasing file name</title>
      <link>https://community.qlik.com/t5/Talend-Studio/delimiter-output-file-with-increasing-file-name/m-p/2295533#M68298</link>
      <description>&lt;P&gt;In this small example there is just a query which will export the values into a csv.&lt;/P&gt; 
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="20-06-_2019_16-22-28.png" style="width: 621px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M64M.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/143497i0F8BB6CDA832C72D/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M64M.png" alt="0683p000009M64M.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;The output file is called "List0.csv".&lt;/P&gt; 
&lt;P&gt;How I can use a counter so that next time when the job will started again&lt;BR /&gt;the output file would look like this "List01.csv".&lt;/P&gt; 
&lt;P&gt;And next time again "List02.csv" etc.&lt;/P&gt; 
&lt;P&gt;&lt;BR /&gt;I tried to use tJavaFlex and the following code&lt;/P&gt; 
&lt;P&gt;int count= Integer.valueOf(counter);&lt;BR /&gt;context.Counter=count+1;&lt;BR /&gt;System.out.println(count);&lt;/P&gt; 
&lt;P&gt;&lt;BR /&gt;but it's not working.&lt;/P&gt; 
&lt;P&gt;Or can I set a global variable which will increase?&lt;/P&gt; 
&lt;P&gt;Thanks for some ideas/hints.&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 05:31:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/delimiter-output-file-with-increasing-file-name/m-p/2295533#M68298</guid>
      <dc:creator>pawe84</dc:creator>
      <dc:date>2024-11-16T05:31:49Z</dc:date>
    </item>
    <item>
      <title>Re: delimiter output file with increasing file name</title>
      <link>https://community.qlik.com/t5/Talend-Studio/delimiter-output-file-with-increasing-file-name/m-p/2295534#M68299</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;A href="https://community.qlik.com/s/profile/0053p000007LMz0AAG"&gt;@pawe84&lt;/A&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Whenever you start the job the global variables/context set earlier will be flushed.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Hence the only way is to store the job count in a file, and in the pre job read the file/Table, add one more to the job count and store to context/Global Variable and use the same context/global variable to name the file.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;After that again update the file/table with new value of the counter.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Thanks and Regards,&lt;/P&gt; 
&lt;P&gt;Subhadip&lt;/P&gt;</description>
      <pubDate>Thu, 20 Jun 2019 15:54:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/delimiter-output-file-with-increasing-file-name/m-p/2295534#M68299</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-06-20T15:54:29Z</dc:date>
    </item>
    <item>
      <title>Re: delimiter output file with increasing file name</title>
      <link>https://community.qlik.com/t5/Talend-Studio/delimiter-output-file-with-increasing-file-name/m-p/2295535#M68300</link>
      <description>&lt;P&gt;Now I tried to use tFileInputDelimited where I read a file with my star value.&lt;/P&gt;
&lt;P&gt;Then the next component is tJavaRow with the following listing&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;context.count=input_row.seq;&lt;/P&gt;
&lt;P&gt;context.count++;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But how I can get&amp;nbsp;context.count now in order to save it&amp;nbsp;tFileOutputDelimited? Which componend I have to use?&lt;/P&gt;
&lt;P&gt;If I use tJavaRow again: output_row.seq=context.count it doesn't work I'll get an error.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 02 Jul 2019 09:21:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/delimiter-output-file-with-increasing-file-name/m-p/2295535#M68300</guid>
      <dc:creator>pawe84</dc:creator>
      <dc:date>2019-07-02T09:21:39Z</dc:date>
    </item>
    <item>
      <title>Re: delimiter output file with increasing file name</title>
      <link>https://community.qlik.com/t5/Talend-Studio/delimiter-output-file-with-increasing-file-name/m-p/2295536#M68301</link>
      <description>&lt;P&gt;Okay, now I got it.&lt;/P&gt;
&lt;P&gt;I used tFixedFlowInput.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is there a way tom reset the counter if a new day/ date is occuring?&lt;/P&gt;
&lt;P&gt;E.g: Today the job was started five times --&amp;gt; stored value=5&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When the job will be started tomorrow that there's a reset --&amp;gt; stored value=0 ?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 02 Jul 2019 09:41:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/delimiter-output-file-with-increasing-file-name/m-p/2295536#M68301</guid>
      <dc:creator>pawe84</dc:creator>
      <dc:date>2019-07-02T09:41:46Z</dc:date>
    </item>
    <item>
      <title>Re: delimiter output file with increasing file name</title>
      <link>https://community.qlik.com/t5/Talend-Studio/delimiter-output-file-with-increasing-file-name/m-p/2295537#M68302</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp;The best way is to store the date and running value to a database table (if not available, then use a control csv file).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; It should have two columns i.e., the date and current file sequence number. So at the beginning of your job, you will have to compare whether the date in the table(or file) is same as current date. If the condition is wrong, you can start the job with initial value i.e. 0.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; If the condition for date is correct, you can assign the current value+1 to a context variable and use this value while creating the file name.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; Once the process is successfully completed, you need to insert both current date and current context value back to DB (or file) so that you can repeat the same process next time.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Warm Regards,&lt;BR /&gt;Nikhil Thampi&lt;/P&gt;
&lt;P&gt;Please appreciate our Talend community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 02 Jul 2019 19:22:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/delimiter-output-file-with-increasing-file-name/m-p/2295537#M68302</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-07-02T19:22:27Z</dc:date>
    </item>
  </channel>
</rss>

