<?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: [resolved] String index out of range error in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/resolved-String-index-out-of-range-error/m-p/2296476#M69133</link>
    <description>Hi,&lt;BR /&gt;Thanks for your answer, i will try as soon as possible &lt;BR /&gt;Best Regards&lt;BR /&gt;Bahadir</description>
    <pubDate>Fri, 05 Aug 2011 12:13:44 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2011-08-05T12:13:44Z</dc:date>
    <item>
      <title>[resolved] String index out of range error</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-String-index-out-of-range-error/m-p/2296474#M69131</link>
      <description>Hi all;&lt;BR /&gt;I am trying to read data from xml file and write them to Mysql db. In my db House_no field's data type is String(40). In xml file there are some house no values that longer than 40 and i want to cut all the values that are greater than 40.&lt;BR /&gt;so i try the code below in tMap but i got "java.lang.StringIndexOutOfBoundsException: String index out of range: 40 at java.lang.String.substring(Unknown Source)" error?&lt;BR /&gt;row4.house_no.length()&amp;gt;40 ?"" : row4.house_no.substring(0,40)&lt;BR /&gt;Do you have any idea what cause this error, or a better way to take 0-40 character without using tJavaRow.&lt;BR /&gt;Best Regards&lt;BR /&gt;Bahadir</description>
      <pubDate>Sat, 16 Nov 2024 12:45:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-String-index-out-of-range-error/m-p/2296474#M69131</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-11-16T12:45:42Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] String index out of range error</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-String-index-out-of-range-error/m-p/2296475#M69132</link>
      <description>substring throws that error if the String length if less than 40 because it tries to get 40 characters. Instead use StringHandling.LEFT(row4.house_no,40) on its own. (Also, your expression is actually setting the house_no to blank if it's longer than 40 characters.)</description>
      <pubDate>Fri, 05 Aug 2011 03:18:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-String-index-out-of-range-error/m-p/2296475#M69132</guid>
      <dc:creator>alevy</dc:creator>
      <dc:date>2011-08-05T03:18:19Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] String index out of range error</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-String-index-out-of-range-error/m-p/2296476#M69133</link>
      <description>Hi,&lt;BR /&gt;Thanks for your answer, i will try as soon as possible &lt;BR /&gt;Best Regards&lt;BR /&gt;Bahadir</description>
      <pubDate>Fri, 05 Aug 2011 12:13:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-String-index-out-of-range-error/m-p/2296476#M69133</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-08-05T12:13:44Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] String index out of range error</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-String-index-out-of-range-error/m-p/2296477#M69134</link>
      <description>Hi again, 
&lt;BR /&gt;I have tried your suggestion as, StringHandling.LEFT(row4.house_no,40) but i am getting 
&lt;BR /&gt;"Exception in component tMap_14 
&lt;BR /&gt;java.lang.NullPointerException 
&lt;BR /&gt;at routines.StringHandling.LEFT(StringHandling.java:184)" error. Do you have any idea to solve this issue? 
&lt;BR /&gt;Best Regards 
&lt;BR /&gt;Bahadir</description>
      <pubDate>Mon, 08 Aug 2011 09:38:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-String-index-out-of-range-error/m-p/2296477#M69134</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-08-08T09:38:26Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] String index out of range error</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-String-index-out-of-range-error/m-p/2296478#M69135</link>
      <description>Hi&lt;BR /&gt;row4.house_no.trim().length()&amp;gt;40 ?"" : row4.house_no.trim().substring(0,39)</description>
      <pubDate>Mon, 08 Aug 2011 10:01:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-String-index-out-of-range-error/m-p/2296478#M69135</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-08-08T10:01:55Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] String index out of range error</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-String-index-out-of-range-error/m-p/2296479#M69136</link>
      <description>Hi,&lt;BR /&gt;Thanks for you answer, i have tried as you wrote and i got &lt;BR /&gt;"Exception in component tMap_14&lt;BR /&gt;java.lang.StringIndexOutOfBoundsException: String index out of range: 39&lt;BR /&gt;at java.lang.String.substring(Unknown Source)" error?&lt;BR /&gt;Best Regards&lt;BR /&gt;Bahadir</description>
      <pubDate>Mon, 08 Aug 2011 10:20:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-String-index-out-of-range-error/m-p/2296479#M69136</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-08-08T10:20:03Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] String index out of range error</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-String-index-out-of-range-error/m-p/2296480#M69137</link>
      <description>Hi&lt;BR /&gt;Sorry my mistake&lt;BR /&gt;row4.house_no.trim().length()&amp;lt;40 ?row4.house_no.trim() : row4.house_no.trim().substring(0,39)</description>
      <pubDate>Mon, 08 Aug 2011 10:25:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-String-index-out-of-range-error/m-p/2296480#M69137</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-08-08T10:25:46Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] String index out of range error</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-String-index-out-of-range-error/m-p/2296481#M69138</link>
      <description>Hi,
&lt;BR /&gt;After 158 row i am getting ""Exception in component tMap_14 java.lang.NullPointerException" again! ?
&lt;BR /&gt;Best Regards
&lt;BR /&gt;Bahadir</description>
      <pubDate>Mon, 08 Aug 2011 11:07:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-String-index-out-of-range-error/m-p/2296481#M69138</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-08-08T11:07:33Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] String index out of range error</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-String-index-out-of-range-error/m-p/2296482#M69139</link>
      <description>Hi&lt;BR /&gt;Add Relational.ISNULL(row4.house_no)?"":row4.house_no.trim().length()&amp;lt;40 ?row4.house_no.trim() : row4.house_no.trim().substring(0,39)</description>
      <pubDate>Mon, 08 Aug 2011 11:10:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-String-index-out-of-range-error/m-p/2296482#M69139</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-08-08T11:10:02Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] String index out of range error</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-String-index-out-of-range-error/m-p/2296483#M69140</link>
      <description>Hi,&lt;BR /&gt;This one works great, thanks. But can you explain how does it work, i could not figure out?&lt;BR /&gt;Best Regards&lt;BR /&gt;Bahadir</description>
      <pubDate>Mon, 08 Aug 2011 11:53:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-String-index-out-of-range-error/m-p/2296483#M69140</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-08-08T11:53:14Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] String index out of range error</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-String-index-out-of-range-error/m-p/2296484#M69141</link>
      <description>Hi
&lt;BR /&gt;It will first check row4.house_no is null or not, if null then it will assign blank values
&lt;BR /&gt;If not null, it will check the legth of the house_no, if less than 40 no change
&lt;BR /&gt;else
&lt;BR /&gt;row4.house_no= row4.house_no.trim().substring(0,39) //take only the first 40 characters
&lt;BR /&gt;as in java the numbering starts from 0 so the max should be 39
&lt;BR /&gt;hope it clarifies you.</description>
      <pubDate>Mon, 08 Aug 2011 12:40:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-String-index-out-of-range-error/m-p/2296484#M69141</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-08-08T12:40:50Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] String index out of range error</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-String-index-out-of-range-error/m-p/2296485#M69142</link>
      <description>Hi,&lt;BR /&gt;Thank you for your answer, it helps very much.&lt;BR /&gt;Best Regards&lt;BR /&gt;Bahadir</description>
      <pubDate>Mon, 08 Aug 2011 16:37:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-String-index-out-of-range-error/m-p/2296485#M69142</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-08-08T16:37:49Z</dc:date>
    </item>
  </channel>
</rss>

