<?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: How to use Substring and Instr function? in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/How-to-use-Substring-and-Instr-function/m-p/2363936#M127744</link>
    <description>Hi Lucian, 
&lt;BR /&gt;There is no straight forward way to do it using talend component, but you can easily do it it using Java way. 
&lt;BR /&gt;1) Import and use 
&lt;A href="http://commons.apache.org/proper/commons-io/download_io.cgi" rel="nofollow noopener noreferrer"&gt;http://commons.apache.org/proper/commons-io/download_io.cgi&lt;/A&gt; commons-io.jar file using tlibrary load 
&lt;BR /&gt;2) Import library import org.apache.commons.io.FilenameUtils; or copy jar file in lib folder and restart talend 
&lt;BR /&gt;3) in Tjava use following code 
&lt;BR /&gt;String foo = " 
&lt;A href="http://www.mydomain-1.com/a/b/c/image1.jpg" rel="nofollow noopener noreferrer"&gt;http://www.mydomain-1.com/a/b/c/image1.jpg&lt;/A&gt;"; 
&lt;BR /&gt; String baseName = FilenameUtils.getBaseName(foo); 
&lt;BR /&gt; String extension = FilenameUtils.getExtension(foo); 
&lt;BR /&gt; System.out.println("file name is : " + baseName+"."+extension); 
&lt;BR /&gt;I think you got an idea, change your code to fit your requirement. 
&lt;BR /&gt;Thanks 
&lt;BR /&gt;Vaibhav</description>
    <pubDate>Mon, 07 Apr 2014 08:01:24 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2014-04-07T08:01:24Z</dc:date>
    <item>
      <title>How to use Substring and Instr function?</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-use-Substring-and-Instr-function/m-p/2363931#M127739</link>
      <description>Hi ,&lt;BR /&gt;I am not sure what is the correct syntax for the substring and the instr used in the tmap component of talend.&lt;BR /&gt;I the string coming in the format like below:-&lt;BR /&gt;"Anatasio::50.00,Received"&lt;BR /&gt;Now I just need to extract 50.00 from the above sting not sure what is the correct syntax i will use in tmap component.&lt;BR /&gt;Please help on this</description>
      <pubDate>Wed, 14 Aug 2013 18:03:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-use-Substring-and-Instr-function/m-p/2363931#M127739</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-08-14T18:03:06Z</dc:date>
    </item>
    <item>
      <title>Re: How to use Substring and Instr function?</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-use-Substring-and-Instr-function/m-p/2363932#M127740</link>
      <description>You have to use the Java language:
&lt;BR /&gt;row1.my_string.substring(row1.my_string.indexOf("::")+2, row1.my_string.indexOf(","))
&lt;BR /&gt; returns your 50.00 value as String
&lt;BR /&gt;If you need this as number:
&lt;BR /&gt;Double.valueOf(row1.my_string.substring(row1.my_string.indexOf("::")+2, row1.my_string.indexOf(",")))</description>
      <pubDate>Wed, 14 Aug 2013 21:14:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-use-Substring-and-Instr-function/m-p/2363932#M127740</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-08-14T21:14:01Z</dc:date>
    </item>
    <item>
      <title>Re: How to use Substring and Instr function?</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-use-Substring-and-Instr-function/m-p/2363933#M127741</link>
      <description>Thanks that works perfectly fine. 
&lt;BR /&gt;Just one more question if I need to apply the if else condition also. For eg. I have my incoming sting in two format:- 
&lt;BR /&gt;"Anatasio::50.00,Received" 
&lt;BR /&gt;"Michael wasnowaski ::70" 
&lt;BR /&gt;So I need to apply the condition 
&lt;BR /&gt;if my input sting has ', ' then 
&lt;BR /&gt;(Double.valueOf(row1.my_string.substring(row1.my_string.indexOf("::")+2, row1.my_string.indexOf(",")))) 
&lt;BR /&gt;else 
&lt;BR /&gt;other function 
&lt;BR /&gt;So how do I write the if else function in the tmap component for this.</description>
      <pubDate>Thu, 15 Aug 2013 00:13:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-use-Substring-and-Instr-function/m-p/2363933#M127741</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-08-15T00:13:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to use Substring and Instr function?</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-use-Substring-and-Instr-function/m-p/2363934#M127742</link>
      <description>You can do this with the ? operator.
&lt;BR /&gt;&amp;lt;condition&amp;gt; ? &amp;lt;expression for true&amp;gt; : &amp;lt;expression for false&amp;gt;
&lt;BR /&gt;You could also consider using regulary expressions. But this field is probably only useful if you decide to get deeper knowledge about that.</description>
      <pubDate>Thu, 15 Aug 2013 16:38:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-use-Substring-and-Instr-function/m-p/2363934#M127742</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-08-15T16:38:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to use Substring and Instr function?</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-use-Substring-and-Instr-function/m-p/2363935#M127743</link>
      <description>Hello guys,&lt;BR /&gt;what if I have a column with URL"s like:&lt;BR /&gt;&lt;A href="http://www.mydomain-1.com/a/b/c/image1.jpg" rel="nofollow noopener noreferrer"&gt;http://www.mydomain-1.com/a/b/c/image1.jpg&lt;/A&gt;&lt;BR /&gt;&lt;A href="http://www.mydomain-2.com/j/u/image2.jpg" rel="nofollow noopener noreferrer"&gt;http://www.mydomain-2.com/j/u/image2.jpg&lt;/A&gt;&lt;BR /&gt;.....&lt;BR /&gt;&lt;A href="http://www.mydomain-x.com/f/r/y/w/image20000.jpg" rel="nofollow noopener noreferrer"&gt;http://www.mydomain-x.com/f/r/y/w/image20000.jpg&lt;/A&gt;&lt;BR /&gt;The ulrs have not the same lenght, domains and subfolders.&lt;BR /&gt;How can I substract only the base name of the image, like:&lt;BR /&gt;image1.jpg&lt;BR /&gt;image2.jpg&lt;BR /&gt;...&lt;BR /&gt;image20000.jpg&lt;BR /&gt;Thank you for your help,&lt;BR /&gt;Lucian</description>
      <pubDate>Sun, 06 Apr 2014 07:28:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-use-Substring-and-Instr-function/m-p/2363935#M127743</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-04-06T07:28:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to use Substring and Instr function?</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-use-Substring-and-Instr-function/m-p/2363936#M127744</link>
      <description>Hi Lucian, 
&lt;BR /&gt;There is no straight forward way to do it using talend component, but you can easily do it it using Java way. 
&lt;BR /&gt;1) Import and use 
&lt;A href="http://commons.apache.org/proper/commons-io/download_io.cgi" rel="nofollow noopener noreferrer"&gt;http://commons.apache.org/proper/commons-io/download_io.cgi&lt;/A&gt; commons-io.jar file using tlibrary load 
&lt;BR /&gt;2) Import library import org.apache.commons.io.FilenameUtils; or copy jar file in lib folder and restart talend 
&lt;BR /&gt;3) in Tjava use following code 
&lt;BR /&gt;String foo = " 
&lt;A href="http://www.mydomain-1.com/a/b/c/image1.jpg" rel="nofollow noopener noreferrer"&gt;http://www.mydomain-1.com/a/b/c/image1.jpg&lt;/A&gt;"; 
&lt;BR /&gt; String baseName = FilenameUtils.getBaseName(foo); 
&lt;BR /&gt; String extension = FilenameUtils.getExtension(foo); 
&lt;BR /&gt; System.out.println("file name is : " + baseName+"."+extension); 
&lt;BR /&gt;I think you got an idea, change your code to fit your requirement. 
&lt;BR /&gt;Thanks 
&lt;BR /&gt;Vaibhav</description>
      <pubDate>Mon, 07 Apr 2014 08:01:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-use-Substring-and-Instr-function/m-p/2363936#M127744</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-04-07T08:01:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to use Substring and Instr function?</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-use-Substring-and-Instr-function/m-p/2363937#M127745</link>
      <description>hi all,&lt;BR /&gt;do not use java code but tFileProperties that contain base name information.&lt;BR /&gt;regards&lt;BR /&gt;laurent</description>
      <pubDate>Mon, 07 Apr 2014 13:44:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-use-Substring-and-Instr-function/m-p/2363937#M127745</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-04-07T13:44:19Z</dc:date>
    </item>
  </channel>
</rss>

