<?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: Dynamic FileName Change in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/Dynamic-FileName-Change/m-p/2287516#M61092</link>
    <description>&lt;P&gt;You just need to use a tiny bit of Java. It is probably better to turn this into a routine so that your code doesn't look messy in your job, but this is how you would do without a routine....&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;((String)globalMap.get("tFileList_1")).substring(0,((String)globalMap.get("tFileList_1")).indexOf('.'))+".xls"&lt;/PRE&gt;
&lt;P&gt;&lt;SPAN class="s1"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="s1"&gt;As a routine it might look like this......&lt;/SPAN&gt;&lt;/P&gt;
&lt;PRE&gt;public static String replaceFileExtension(String filename, String extension){
     String returnVal = filename;
     
    if(filename!=null &amp;amp;&amp;amp; filename.indexOf('.')&amp;gt;-1){
           returnVal = filename.substring(0, filename.indexOf('.'))+"."+extension;
    }
    return returnVal;
}&lt;/PRE&gt;
&lt;P&gt;&lt;SPAN class="s1"&gt;You would use the above like below....&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;replaceFileExtension(((String)globalMap.get("tFileList_1")), "xls")&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="s1"&gt;#I should point out that I have written this freehand so there may be a couple of tweaks required.&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 09 Oct 2017 11:55:55 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2017-10-09T11:55:55Z</dc:date>
    <item>
      <title>Dynamic FileName Change</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Dynamic-FileName-Change/m-p/2287515#M61091</link>
      <description>&lt;P&gt;Hi Team&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a simple Scenario&lt;/P&gt;&lt;P&gt;Using tFileList &amp;nbsp;i am reading a list of files and converting them to excel formats&lt;/P&gt;&lt;P&gt;while doing this process i want target file name to same as source file name but with Excel extension&lt;/P&gt;&lt;P&gt;How can this be achived,&lt;/P&gt;&lt;P&gt;I am using Using "((String)globalMap.get("tFileList_1"))" to get the filname,but i am getting file name along with source extension.&lt;/P&gt;&lt;P&gt;I am attaching the screenshot here with&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please help me out how this can be done&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance&lt;/P&gt;&lt;P&gt;Deepthi&lt;/P&gt;&lt;P&gt;Deepthi&lt;/P&gt;</description>
      <pubDate>Mon, 09 Oct 2017 11:40:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Dynamic-FileName-Change/m-p/2287515#M61091</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-10-09T11:40:07Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic FileName Change</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Dynamic-FileName-Change/m-p/2287516#M61092</link>
      <description>&lt;P&gt;You just need to use a tiny bit of Java. It is probably better to turn this into a routine so that your code doesn't look messy in your job, but this is how you would do without a routine....&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;((String)globalMap.get("tFileList_1")).substring(0,((String)globalMap.get("tFileList_1")).indexOf('.'))+".xls"&lt;/PRE&gt;
&lt;P&gt;&lt;SPAN class="s1"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="s1"&gt;As a routine it might look like this......&lt;/SPAN&gt;&lt;/P&gt;
&lt;PRE&gt;public static String replaceFileExtension(String filename, String extension){
     String returnVal = filename;
     
    if(filename!=null &amp;amp;&amp;amp; filename.indexOf('.')&amp;gt;-1){
           returnVal = filename.substring(0, filename.indexOf('.'))+"."+extension;
    }
    return returnVal;
}&lt;/PRE&gt;
&lt;P&gt;&lt;SPAN class="s1"&gt;You would use the above like below....&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;replaceFileExtension(((String)globalMap.get("tFileList_1")), "xls")&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="s1"&gt;#I should point out that I have written this freehand so there may be a couple of tweaks required.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 09 Oct 2017 11:55:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Dynamic-FileName-Change/m-p/2287516#M61092</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-10-09T11:55:55Z</dc:date>
    </item>
  </channel>
</rss>

