<?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: Get substr of a global variable in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/Get-substr-of-a-global-variable/m-p/2334255#M102941</link>
    <description>Thanks for your reply. It works very well 
&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;When you talk of a routine, do you mean a routine inside the tMap of a new component allowing to make routine ?</description>
    <pubDate>Thu, 28 Jan 2016 11:38:22 GMT</pubDate>
    <dc:creator>_AnonymousUser</dc:creator>
    <dc:date>2016-01-28T11:38:22Z</dc:date>
    <item>
      <title>Get substr of a global variable</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Get-substr-of-a-global-variable/m-p/2334252#M102938</link>
      <description>&lt;P&gt;Hello,&lt;BR /&gt;On the expression field of a tMap I use the following :&lt;/P&gt; 
&lt;PRE&gt;(String)globalMap.get("tFileList_1_CURRENT_FILE")&lt;/PRE&gt; 
&lt;P&gt;&lt;BR /&gt;This variable can have for instance the followings values :&lt;BR /&gt;SERVER11_20160101.log&lt;BR /&gt;SMTPSERVER11_20160101.log&lt;BR /&gt;I would like to get the value betwwen _ and . i.e. 20160101&lt;BR /&gt;Could you please tell me how I can do that in the simplest way ?&lt;BR /&gt;Thanks in advance&lt;BR /&gt;Regards&lt;BR /&gt;Frey1&lt;/P&gt;</description>
      <pubDate>Wed, 27 Jan 2016 16:55:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Get-substr-of-a-global-variable/m-p/2334252#M102938</guid>
      <dc:creator>_AnonymousUser</dc:creator>
      <dc:date>2016-01-27T16:55:14Z</dc:date>
    </item>
    <item>
      <title>Re: Get substr of a global variable</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Get-substr-of-a-global-variable/m-p/2334253#M102939</link>
      <description>[font=consolas, monaco, bitstream vera sans mono, courier new, courier, monospace]
&lt;FONT size="2"&gt;This should work......&lt;/FONT&gt;[/font]&amp;nbsp; 
&lt;BR /&gt;
&lt;BR /&gt;
&lt;PRE&gt;((String)globalMap.get("tFileList_1_CURRENT_FILE")).substring(((String)globalMap.get("tFileList_1_CURRENT_FILE")).indexOf("_")+1, (((String)globalMap.get("tFileList_1_CURRENT_FILE")).indexOf(".log")));&lt;BR /&gt;&lt;/PRE&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;It's not simple though. To simplify it, think of it in this way.....
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;PRE&gt;myValue.substring(myValue.indexOf("_")+1, myValue.indexOf(".log"));&lt;/PRE&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;You could always create a Routine to do this which will make it even easier to understand.</description>
      <pubDate>Wed, 27 Jan 2016 17:12:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Get-substr-of-a-global-variable/m-p/2334253#M102939</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-01-27T17:12:30Z</dc:date>
    </item>
    <item>
      <title>Re: Get substr of a global variable</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Get-substr-of-a-global-variable/m-p/2334254#M102940</link>
      <description>I should have added, you will want to check for null first and if you cannot ensure that "_" and ".log" will exist, you will need to trap those scenarios as well. I'd create a Routine. But the code I have given you should be a good basis for that.</description>
      <pubDate>Wed, 27 Jan 2016 17:14:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Get-substr-of-a-global-variable/m-p/2334254#M102940</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-01-27T17:14:24Z</dc:date>
    </item>
    <item>
      <title>Re: Get substr of a global variable</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Get-substr-of-a-global-variable/m-p/2334255#M102941</link>
      <description>Thanks for your reply. It works very well 
&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;When you talk of a routine, do you mean a routine inside the tMap of a new component allowing to make routine ?</description>
      <pubDate>Thu, 28 Jan 2016 11:38:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Get-substr-of-a-global-variable/m-p/2334255#M102941</guid>
      <dc:creator>_AnonymousUser</dc:creator>
      <dc:date>2016-01-28T11:38:22Z</dc:date>
    </item>
    <item>
      <title>Re: Get substr of a global variable</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Get-substr-of-a-global-variable/m-p/2334256#M102942</link>
      <description>If you go to your project tree, look for "Code" and expand it, you will see where the routines are. Routines are essentially Java classes. You can create your own bespoke functions here that can be called anywhere in a Talend job. This is really useful for stuff like this and allows you present the code in a far easier way to read. It also means that you can write functions that require several different lines of code to achieve. Using Java code in tMap components kind of limits you to a single line of code.</description>
      <pubDate>Thu, 28 Jan 2016 11:53:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Get-substr-of-a-global-variable/m-p/2334256#M102942</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-01-28T11:53:11Z</dc:date>
    </item>
    <item>
      <title>Re: Get substr of a global variable</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Get-substr-of-a-global-variable/m-p/2334257#M102943</link>
      <description>Ok, thanks a lot for your help 
&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;</description>
      <pubDate>Fri, 29 Jan 2016 08:56:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Get-substr-of-a-global-variable/m-p/2334257#M102943</guid>
      <dc:creator>_AnonymousUser</dc:creator>
      <dc:date>2016-01-29T08:56:57Z</dc:date>
    </item>
  </channel>
</rss>

