<?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 [resolved] Generate a dynamic file name for tFileOutputMSXML in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/resolved-Generate-a-dynamic-file-name-for-tFileOutputMSXML/m-p/2366398#M129893</link>
    <description>Hi all.
&lt;BR /&gt;I'm a newbie with Talend and I'm using a tFileOutpuMSXML to generate a XML file base on MySQL db filled from a list of files read from a folder (thanks to a tFileList).
&lt;BR /&gt;I would like to generate a new XML file for each file found in tFileList. First I thought it will be possible to create a dynamic fileName for my MSXML output but it seem impossible (the fileName is generated at launch of th job, the solution would be to close the xml file, regenerate a new file name and reopen the file in a Java Row but I wasn't able to do it).
&lt;BR /&gt;Is there a solution to create a new file with either a unique name for each file read by the FileList or dynamicaly set a file name for each of these files thanks to the manipulation I described but I wasn't able to do?
&lt;BR /&gt;BR</description>
    <pubDate>Tue, 29 Jul 2014 07:56:59 GMT</pubDate>
    <dc:creator>_AnonymousUser</dc:creator>
    <dc:date>2014-07-29T07:56:59Z</dc:date>
    <item>
      <title>[resolved] Generate a dynamic file name for tFileOutputMSXML</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-Generate-a-dynamic-file-name-for-tFileOutputMSXML/m-p/2366398#M129893</link>
      <description>Hi all.
&lt;BR /&gt;I'm a newbie with Talend and I'm using a tFileOutpuMSXML to generate a XML file base on MySQL db filled from a list of files read from a folder (thanks to a tFileList).
&lt;BR /&gt;I would like to generate a new XML file for each file found in tFileList. First I thought it will be possible to create a dynamic fileName for my MSXML output but it seem impossible (the fileName is generated at launch of th job, the solution would be to close the xml file, regenerate a new file name and reopen the file in a Java Row but I wasn't able to do it).
&lt;BR /&gt;Is there a solution to create a new file with either a unique name for each file read by the FileList or dynamicaly set a file name for each of these files thanks to the manipulation I described but I wasn't able to do?
&lt;BR /&gt;BR</description>
      <pubDate>Tue, 29 Jul 2014 07:56:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-Generate-a-dynamic-file-name-for-tFileOutputMSXML/m-p/2366398#M129893</guid>
      <dc:creator>_AnonymousUser</dc:creator>
      <dc:date>2014-07-29T07:56:59Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] Generate a dynamic file name for tFileOutputMSXML</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-Generate-a-dynamic-file-name-for-tFileOutputMSXML/m-p/2366399#M129894</link>
      <description>As it seemed that nobody had an answer about my request, I had to find another solution... and I did. Here is what I've done: 
&lt;BR /&gt; 
&lt;BR /&gt;I created a tSetGlobalVar called, e.g., "myVar" 
&lt;BR /&gt;In a tJavaRow, I create a string called "myFileName" which is the dynamic part of the file name 
&lt;BR /&gt;In&amp;nbsp;the same&amp;nbsp;tJavaRow, I added the following code: 
&lt;BR /&gt; 
&lt;BR /&gt; 
&lt;PRE&gt;&lt;FONT size="2"&gt;globalMap.put(&lt;/FONT&gt;&lt;FONT color="#2a00ff"&gt;&lt;FONT size="2"&gt;"myVar"&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size="2"&gt;, myFileName.concat(&lt;/FONT&gt;&lt;FONT color="#2a00ff"&gt;&lt;FONT size="2"&gt;".xml"&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size="2"&gt;));&lt;/FONT&gt;&lt;/PRE&gt; 
&lt;BR /&gt; 
&lt;BR /&gt;I set the following file name for my tFileOutpuMSXML output: "C:/Users/cyrilp/Desktop/OutPutXML.xml" 
&lt;BR /&gt;I created a tFileCopy linked to my tFileOutputMSXML element thanks to a OnComponentOK event 
&lt;BR /&gt;I set the following parameters to my tFileCopy : 
&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; - File name: "C:/Users/cyrilp/Desktop/OutPutXML.xml" 
&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; - Destination folder: whatever you want 
&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; - Rename: enabled 
&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; - Destination file: ((String)globalMap.get("myVar")) 
&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; - Remove source file: enabled 
&lt;BR /&gt;Then, it did the work! 
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MACn.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/154443iC5B8CACEF3D12C6A/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MACn.png" alt="0683p000009MACn.png" /&gt;&lt;/span&gt; 
&lt;BR /&gt;I don't know if it's the best way to solve a similar problem or if it would be possible to apply this on any case but it worked for me. 
&lt;BR /&gt;BR</description>
      <pubDate>Wed, 30 Jul 2014 10:41:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-Generate-a-dynamic-file-name-for-tFileOutputMSXML/m-p/2366399#M129894</guid>
      <dc:creator>_AnonymousUser</dc:creator>
      <dc:date>2014-07-30T10:41:32Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] Generate a dynamic file name for tFileOutputMSXML</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-Generate-a-dynamic-file-name-for-tFileOutputMSXML/m-p/2366400#M129895</link>
      <description>Hi BR,&lt;BR /&gt;Glad that you have found the solution on your own and thanks for posting the solution.&lt;BR /&gt;Thanks&lt;BR /&gt;Vaibhav</description>
      <pubDate>Wed, 30 Jul 2014 11:00:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-Generate-a-dynamic-file-name-for-tFileOutputMSXML/m-p/2366400#M129895</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-07-30T11:00:40Z</dc:date>
    </item>
  </channel>
</rss>

