<?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: Change filename for tFileOutputDelimited in tloop in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/Change-filename-for-tFileOutputDelimited-in-tloop/m-p/2486305#M141387</link>
    <description>&lt;P&gt;Hello&lt;/P&gt;
&lt;P&gt;You can set a dynamic output file path based on the input data. Can you show us how do you define the file path on tJavaRow or tFileOutputDelimited?&lt;/P&gt;
&lt;P&gt;Regards&lt;/P&gt;
&lt;P&gt;Shicong&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 10 Oct 2024 03:19:36 GMT</pubDate>
    <dc:creator>Shicong_Hong</dc:creator>
    <dc:date>2024-10-10T03:19:36Z</dc:date>
    <item>
      <title>Change filename for tFileOutputDelimited in tloop</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Change-filename-for-tFileOutputDelimited-in-tloop/m-p/2486201#M141380</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I've got a tloop component and within the loop, I want to write data to a file using tFileOutputDelimited, but i want to dynamically change the name depending on the data. I've tried doing this via a tJavarow but I get a java.io.FileNotFoundException:&amp;nbsp;C:\talend\Talend-Studio-20231027_1100-V8.0.1 error, with C:\talend\Talend-Studio-20231027_1100-V8.0.1 being where talend is installed and not where I want the file to be. &lt;/P&gt;
&lt;P&gt;Is it actually possible to do this in the way I want? Or do I have to use a "temporary" file and move the data to the final file(s) outside of the loop?&lt;/P&gt;
&lt;P&gt;Part of the loop&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="MDouglas1687874333_0-1728479605364.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/172737i84527B372221EB86/image-size/medium?v=v2&amp;amp;px=400" role="button" title="MDouglas1687874333_0-1728479605364.png" alt="MDouglas1687874333_0-1728479605364.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 09 Oct 2024 13:24:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Change-filename-for-tFileOutputDelimited-in-tloop/m-p/2486201#M141380</guid>
      <dc:creator>MDouglas1687874333</dc:creator>
      <dc:date>2024-10-09T13:24:42Z</dc:date>
    </item>
    <item>
      <title>Re: Change filename for tFileOutputDelimited in tloop</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Change-filename-for-tFileOutputDelimited-in-tloop/m-p/2486305#M141387</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;
&lt;P&gt;You can set a dynamic output file path based on the input data. Can you show us how do you define the file path on tJavaRow or tFileOutputDelimited?&lt;/P&gt;
&lt;P&gt;Regards&lt;/P&gt;
&lt;P&gt;Shicong&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 10 Oct 2024 03:19:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Change-filename-for-tFileOutputDelimited-in-tloop/m-p/2486305#M141387</guid>
      <dc:creator>Shicong_Hong</dc:creator>
      <dc:date>2024-10-10T03:19:36Z</dc:date>
    </item>
    <item>
      <title>Re: Change filename for tFileOutputDelimited in tloop</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Change-filename-for-tFileOutputDelimited-in-tloop/m-p/2486626#M141395</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I have the solution in attach:&lt;/P&gt;
&lt;P&gt;tFixedFlowInput_2: it produces file names with a placeholder $1&lt;/P&gt;
&lt;P&gt;tSetGlobalVar: it substitutes the placeholder with the iteration number and it generates file name to write.&lt;/P&gt;
&lt;LI-CODE lang="java"&gt;((String)globalMap.get("row3.filename")).replaceAll("\\$1", ((Integer)globalMap.get("tFlowToIterate_1_CURRENT_ITERATION")).toString())&lt;/LI-CODE&gt;
&lt;P&gt;tFixedInput_3: it produces the row to write&lt;/P&gt;
&lt;P&gt;tFileOutputDelimited_1: it writes the files.&lt;/P&gt;
&lt;P&gt;You have set file name field like this:&lt;/P&gt;
&lt;LI-CODE lang="java"&gt;"C:/Talend-Studio/studio/workspace_locale/"+((String)globalMap.get("instanceFilename"))&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I hope it is useful for you!&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 11 Oct 2024 18:29:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Change-filename-for-tFileOutputDelimited-in-tloop/m-p/2486626#M141395</guid>
      <dc:creator>fcolagiacomo</dc:creator>
      <dc:date>2024-10-11T18:29:45Z</dc:date>
    </item>
    <item>
      <title>Re: Change filename for tFileOutputDelimited in tloop</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Change-filename-for-tFileOutputDelimited-in-tloop/m-p/2487299#M141408</link>
      <description>&lt;P&gt;Thanks! I managed to use a version of this (tJavarow instead of tSetGlobalVar as I needed to use a few different outputs to set the filename) and it's working now. Turns out I just needed to move the filename setting to before the flowtoiterate as having it after was causing the name to not be set correctly.&lt;/P&gt;</description>
      <pubDate>Wed, 16 Oct 2024 08:34:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Change-filename-for-tFileOutputDelimited-in-tloop/m-p/2487299#M141408</guid>
      <dc:creator>MDouglas1687874333</dc:creator>
      <dc:date>2024-10-16T08:34:56Z</dc:date>
    </item>
  </channel>
</rss>

