<?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: Converting strings into proper / title case using Java in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/Converting-strings-into-proper-title-case-using-Java/m-p/2215054#M11627</link>
    <description>Also, thank you both for the info on the Split function, it turns out to be rather easy doesn't it. Would you recommend using Java code or the tExtractDelimtedFields component?</description>
    <pubDate>Thu, 10 Feb 2011 14:58:27 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2011-02-10T14:58:27Z</dc:date>
    <item>
      <title>Converting strings into proper / title case using Java</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Converting-strings-into-proper-title-case-using-Java/m-p/2215048#M11621</link>
      <description>&lt;P&gt;Hi, how would you go about converting a string which is all upper case into capital first letter only for the whole sentence (proper/title case)? There does not seem to be a Talend string function for this and neither built-in to the basic Java libraries.&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 13:05:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Converting-strings-into-proper-title-case-using-Java/m-p/2215048#M11621</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-11-16T13:05:50Z</dc:date>
    </item>
    <item>
      <title>Re: Converting strings into proper / title case using Java</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Converting-strings-into-proper-title-case-using-Java/m-p/2215049#M11622</link>
      <description>Hi,
&lt;BR /&gt;One of the libraries that comes with Talend has a capitalize() function. It's called Commons Lang and capitalize() is in a class called StringUtils.
&lt;BR /&gt;To use this, use a tLoadLibrary component. Configure it to use the commons-lang-2.5.jar and import the class 'org.apache.commons.lang.StringUtils'. In your tMap, use something like
&lt;BR /&gt;row2.first_name = StringUtils.capitalize(row1.first_name)
&lt;BR /&gt;If you want a quick test, cut-and-paste this in a tJava. 
&lt;BR /&gt;System.out.println( StringUtils.capitalize(null) );
&lt;BR /&gt;System.out.println( StringUtils.capitalize("") );
&lt;BR /&gt;System.out.println( StringUtils.capitalize("cat") );
&lt;BR /&gt;System.out.println( StringUtils.capitalize("cAt") );
&lt;BR /&gt;-Carl</description>
      <pubDate>Thu, 10 Feb 2011 11:54:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Converting-strings-into-proper-title-case-using-Java/m-p/2215049#M11622</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-02-10T11:54:47Z</dc:date>
    </item>
    <item>
      <title>Re: Converting strings into proper / title case using Java</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Converting-strings-into-proper-title-case-using-Java/m-p/2215050#M11623</link>
      <description>Brilliant, thank you. That will solve the problem I am sure. I was not aware that there was such a vast amount of libraries shipped with Talend. 
&lt;BR /&gt;I don't suppose you know where to find a typical string splitting method now that I am thinking of it? We want to grab only the last part of a string, the text after the last comma.</description>
      <pubDate>Thu, 10 Feb 2011 14:23:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Converting-strings-into-proper-title-case-using-Java/m-p/2215050#M11623</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-02-10T14:23:41Z</dc:date>
    </item>
    <item>
      <title>Re: Converting strings into proper / title case using Java</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Converting-strings-into-proper-title-case-using-Java/m-p/2215051#M11624</link>
      <description>You can use java Strring.split method&lt;BR /&gt;ex&lt;BR /&gt;String spt= "Java.How.To.Split";&lt;BR /&gt;spt.split(".")</description>
      <pubDate>Thu, 10 Feb 2011 14:42:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Converting-strings-into-proper-title-case-using-Java/m-p/2215051#M11624</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-02-10T14:42:19Z</dc:date>
    </item>
    <item>
      <title>Re: Converting strings into proper / title case using Java</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Converting-strings-into-proper-title-case-using-Java/m-p/2215052#M11625</link>
      <description>If the standard split() does't work for you, try (from the same Commons Lang / StringUtils class) substringAfterLast(). 
&lt;BR /&gt;Here's a link to the Javadoc. These string functions are useful. 
&lt;A href="http://commons.apache.org/lang/api-release/index.html" rel="nofollow noopener noreferrer"&gt;http://commons.apache.org/lang/api-release/index.html&lt;/A&gt;. 
&lt;BR /&gt;If you want to extend these functions or make some documentation available with them, take a look at this blog post on the topic. 
&lt;BR /&gt; 
&lt;A href="http://bekwam.blogspot.com/2011/02/user-defined-functions-with-talend-open.html" rel="nofollow noopener noreferrer"&gt;http://bekwam.blogspot.com/2011/02/user-defined-functions-with-talend-open.html&lt;/A&gt;</description>
      <pubDate>Thu, 10 Feb 2011 14:56:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Converting-strings-into-proper-title-case-using-Java/m-p/2215052#M11625</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-02-10T14:56:02Z</dc:date>
    </item>
    <item>
      <title>Re: Converting strings into proper / title case using Java</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Converting-strings-into-proper-title-case-using-Java/m-p/2215053#M11626</link>
      <description>I have now tried the tJava example above and it doesn't actually do anything with the strings - this is the output: 
&lt;BR /&gt; 
&lt;PRE&gt;null&lt;BR /&gt;Cat&lt;BR /&gt;CAt&lt;/PRE&gt; 
&lt;BR /&gt;Where exactly am I supposed to write the import line? I have written it under Advanced Settings in the tJava component now like this: 
&lt;BR /&gt;import org.apache.commons.lang.StringUtils;</description>
      <pubDate>Thu, 10 Feb 2011 14:57:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Converting-strings-into-proper-title-case-using-Java/m-p/2215053#M11626</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-02-10T14:57:24Z</dc:date>
    </item>
    <item>
      <title>Re: Converting strings into proper / title case using Java</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Converting-strings-into-proper-title-case-using-Java/m-p/2215054#M11627</link>
      <description>Also, thank you both for the info on the Split function, it turns out to be rather easy doesn't it. Would you recommend using Java code or the tExtractDelimtedFields component?</description>
      <pubDate>Thu, 10 Feb 2011 14:58:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Converting-strings-into-proper-title-case-using-Java/m-p/2215054#M11627</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-02-10T14:58:27Z</dc:date>
    </item>
    <item>
      <title>Re: Converting strings into proper / title case using Java</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Converting-strings-into-proper-title-case-using-Java/m-p/2215055#M11628</link>
      <description>I think you should try both and use the one which is faster</description>
      <pubDate>Thu, 10 Feb 2011 15:02:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Converting-strings-into-proper-title-case-using-Java/m-p/2215055#M11628</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-02-10T15:02:55Z</dc:date>
    </item>
    <item>
      <title>Re: Converting strings into proper / title case using Java</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Converting-strings-into-proper-title-case-using-Java/m-p/2215056#M11629</link>
      <description>Yeah, fair enough, thanks. 
&lt;BR /&gt; 
&lt;BR /&gt;I would like to repeat my previous question as well: 
&lt;BR /&gt; 
&lt;BR /&gt;I have now tried the tJava example above and it doesn't actually do anything with the strings. Where exactly am I supposed to write the import line? I have written it under Advanced Settings in the tJava component now like this: 
&lt;BR /&gt;import org.apache.commons.lang.StringUtils;</description>
      <pubDate>Thu, 10 Feb 2011 17:39:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Converting-strings-into-proper-title-case-using-Java/m-p/2215056#M11629</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-02-10T17:39:44Z</dc:date>
    </item>
    <item>
      <title>Re: Converting strings into proper / title case using Java</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Converting-strings-into-proper-title-case-using-Java/m-p/2215057#M11630</link>
      <description>hi all&lt;BR /&gt;use &lt;A href="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/String.html#toUpperCase%28%29" target="_blank" rel="nofollow noopener noreferrer"&gt;toUppercase() method&lt;/A&gt; to capitalise characters.&lt;BR /&gt; the opposite =&amp;gt; toLowerCase()&lt;BR /&gt;Talend Method : DOWNCASE and UPCASE&lt;BR /&gt;regards&lt;BR /&gt;laurent</description>
      <pubDate>Thu, 10 Feb 2011 21:38:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Converting-strings-into-proper-title-case-using-Java/m-p/2215057#M11630</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-02-10T21:38:43Z</dc:date>
    </item>
    <item>
      <title>Re: Converting strings into proper / title case using Java</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Converting-strings-into-proper-title-case-using-Java/m-p/2215058#M11631</link>
      <description>I should have been more clear - it is not uppercase I want, I want only the first letter of each word to be capital:
&lt;BR /&gt;Just Like This Example</description>
      <pubDate>Fri, 11 Feb 2011 11:29:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Converting-strings-into-proper-title-case-using-Java/m-p/2215058#M11631</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-02-11T11:29:05Z</dc:date>
    </item>
    <item>
      <title>Re: Converting strings into proper / title case using Java</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Converting-strings-into-proper-title-case-using-Java/m-p/2215059#M11632</link>
      <description>In this case You can use String buffer
&lt;BR /&gt;
&lt;BLOCKQUOTE&gt;
 &lt;TABLE border="1"&gt;
  &lt;TBODY&gt;
   &lt;TR&gt;
    &lt;TD&gt;it is not uppercase I want, I want only the first letter of each word to be capital&lt;/TD&gt;
   &lt;/TR&gt;
  &lt;/TBODY&gt;
 &lt;/TABLE&gt;
&lt;/BLOCKQUOTE&gt;
&lt;BR /&gt;ex
&lt;BR /&gt; String a="alpha";
&lt;BR /&gt; StringBuffer abc=new StringBuffer(a);
&lt;BR /&gt; String temp = Character.toString(abc.charAt(0));
&lt;BR /&gt; temp=temp.toUpperCase();
&lt;BR /&gt; abc.setCharAt(0,temp.charAt(0)); 
&lt;BR /&gt; System.out.println(abc);
&lt;BR /&gt;
&lt;B&gt;This case will only work if you know the index number of which Char to change&lt;/B&gt;</description>
      <pubDate>Fri, 11 Feb 2011 11:54:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Converting-strings-into-proper-title-case-using-Java/m-p/2215059#M11632</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-02-11T11:54:32Z</dc:date>
    </item>
    <item>
      <title>Re: Converting strings into proper / title case using Java</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Converting-strings-into-proper-title-case-using-Java/m-p/2215060#M11633</link>
      <description>The following code in a tjava / tjavarow component will do it... Just replace the string literal with your input field name&lt;BR /&gt;String sentence = "";&lt;BR /&gt;String curWord = "";&lt;BR /&gt;String curWordUpper = "";&lt;BR /&gt; String str = "my first talend etl job";&lt;BR /&gt;  String[] temp;&lt;BR /&gt;  /* delimiter */&lt;BR /&gt;  String delimiter = " ";&lt;BR /&gt;  /* given string will be split by the argument delimiter provided. */&lt;BR /&gt;  temp = str.split(delimiter);&lt;BR /&gt;  /* print substrings */&lt;BR /&gt;  for(int i =0; i &amp;lt; temp.length ; i++)&lt;BR /&gt;	{&lt;BR /&gt;  		curWord = temp&lt;I&gt;;&lt;BR /&gt;  		curWordUpper = "";&lt;BR /&gt;  		&lt;BR /&gt;		for (int j = 0; j &amp;lt; curWord.length(); j++)&lt;BR /&gt;		{&lt;BR /&gt;			String next = curWord.substring(j, j + 1);&lt;BR /&gt;			if (j == 0)&lt;BR /&gt;			{&lt;BR /&gt;				curWordUpper += next.toUpperCase();&lt;BR /&gt;			} &lt;BR /&gt;			else &lt;BR /&gt;			{&lt;BR /&gt;				curWordUpper += next.toLowerCase();&lt;BR /&gt;			}&lt;BR /&gt;  		}  &lt;BR /&gt;  		sentence += curWordUpper + " ";&lt;BR /&gt;    //System.out.println(curWord2);&lt;BR /&gt;    }    &lt;BR /&gt;    System.out.println(sentence.trim());&lt;/I&gt;</description>
      <pubDate>Thu, 12 May 2011 18:49:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Converting-strings-into-proper-title-case-using-Java/m-p/2215060#M11633</guid>
      <dc:creator>willm1</dc:creator>
      <dc:date>2011-05-12T18:49:37Z</dc:date>
    </item>
    <item>
      <title>Re: Converting strings into proper / title case using Java</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Converting-strings-into-proper-title-case-using-Java/m-p/2215061#M11634</link>
      <description>There's a WordUtils.capitalize() function in Commons Lang if you want to modify each word in a sentence.
&lt;BR /&gt;WordUtils.captialize(row1.mytext);
&lt;BR /&gt;import org.apache.commons.lang.WordUtils;</description>
      <pubDate>Thu, 12 May 2011 19:30:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Converting-strings-into-proper-title-case-using-Java/m-p/2215061#M11634</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-05-12T19:30:10Z</dc:date>
    </item>
    <item>
      <title>Re: Converting strings into proper / title case using Java</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Converting-strings-into-proper-title-case-using-Java/m-p/2215062#M11635</link>
      <description>I have added the commons Lang by adding to the JRE files and also tried using the Library Loader but my TMap keeps throwing up and error that it doesn't recognise either WordUtils or StringUtils. I want to use the function capitalizeFully to set the first letters of each word in an address string to upper case. 
&lt;BR /&gt;Would someone be kind enough to explain how exactly I can get the function for the commons Lang to work.</description>
      <pubDate>Sun, 26 Aug 2012 17:32:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Converting-strings-into-proper-title-case-using-Java/m-p/2215062#M11635</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-08-26T17:32:57Z</dc:date>
    </item>
    <item>
      <title>Re: Converting strings into proper / title case using Java</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Converting-strings-into-proper-title-case-using-Java/m-p/2215063#M11636</link>
      <description>Hi,
&lt;BR /&gt;Double-check the import statement which is needed in addition to telling Talend where the library is (jar file). If that's ok, post the specific error message.
&lt;BR /&gt;This post has an example that may help you: 
&lt;A href="http://bekwam.blogspot.com/2011/01/java-libraries-in-talend-open-studio.html" rel="nofollow noopener noreferrer"&gt;http://bekwam.blogspot.com/2011/01/java-libraries-in-talend-open-studio.html&lt;/A&gt;.</description>
      <pubDate>Sun, 26 Aug 2012 18:05:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Converting-strings-into-proper-title-case-using-Java/m-p/2215063#M11636</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-08-26T18:05:12Z</dc:date>
    </item>
    <item>
      <title>Re: Converting strings into proper / title case using Java</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Converting-strings-into-proper-title-case-using-Java/m-p/2215064#M11637</link>
      <description>Hi there. Thanks for the prompt reply. I have attached images of the set up and errors. I have tried both ways; to add the Land file under the JRE setting sand with the Loader as you suggested. First images via the Preferences route and the then by Library Loader. 
&lt;BR /&gt;Trying to achieve Word.Utils.capitalizeFully(row1.Address_1) - pic1 
&lt;BR /&gt;Pic2 - added the commons Land to JRE 
&lt;BR /&gt;Pic3 - run error. 
&lt;BR /&gt;Pic4 - now with Library Load basic settings 
&lt;BR /&gt;Pic5 - Advanced settings JAR location and Import string 
&lt;BR /&gt;pic6 - new run error. 
&lt;BR /&gt;I hope this is clear. 
&lt;BR /&gt;Thanks.</description>
      <pubDate>Mon, 27 Aug 2012 09:50:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Converting-strings-into-proper-title-case-using-Java/m-p/2215064#M11637</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-08-27T09:50:58Z</dc:date>
    </item>
    <item>
      <title>Re: Converting strings into proper / title case using Java</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Converting-strings-into-proper-title-case-using-Java/m-p/2215065#M11638</link>
      <description>Hi, 
&lt;BR /&gt;To fix your problem, 
&lt;BR /&gt;1. Switch to commons-lang-2.6.jar in the tLoadLibrary / Basic settings / Library select box 
&lt;BR /&gt;2. Remove everything from Advanced settings / Dynamic libs 
&lt;BR /&gt;3. Add the following path to Advanced settings / import: import org.apache.commons.lang.WordUtils; 
&lt;BR /&gt;4. Use the function in a component like tJavaRow like 
&lt;BR /&gt;output_row.field1 = WordUtils.capitalizeFully(input_row.field1); 
&lt;BR /&gt;I'm having a problem with Commons Lang 3 which may have been installed in your workspace when you installed my tScriptRules component. Apparently, it's in the folder structure and available in the modules list, but TOS isn't recognizing the commons-lang3-3.0.jar as something available on the classpath. It's fine to use Commons Lang 2.6 for what you want. Follow along here: 
&lt;A href="http://www.talendforge.org/forum/viewtopic.php?pid=93369#p93369" rel="nofollow noopener noreferrer"&gt;http://www.talendforge.org/forum/viewtopic.php?pid=93369#p93369&lt;/A&gt;.</description>
      <pubDate>Thu, 30 Aug 2012 00:52:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Converting-strings-into-proper-title-case-using-Java/m-p/2215065#M11638</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-08-30T00:52:40Z</dc:date>
    </item>
    <item>
      <title>Re: Converting strings into proper / title case using Java</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Converting-strings-into-proper-title-case-using-Java/m-p/2215066#M11639</link>
      <description>Carl, you are a scholar and a gentleman?..   All peachy.&lt;BR /&gt;Much appreciated.</description>
      <pubDate>Thu, 30 Aug 2012 15:35:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Converting-strings-into-proper-title-case-using-Java/m-p/2215066#M11639</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-08-30T15:35:00Z</dc:date>
    </item>
    <item>
      <title>Re: Converting strings into proper / title case using Java</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Converting-strings-into-proper-title-case-using-Java/m-p/2215067#M11640</link>
      <description>Hi,
&lt;BR /&gt;Probably you can use following expression in your tMap
&lt;BR /&gt;Expression: 
&lt;BR /&gt;----------------
&lt;BR /&gt;
&lt;B&gt;row1.TitleString.toLowerCase().replaceFirst("", row1.TitleString.substring(0,1).toUpperCase()) &lt;/B&gt;
&lt;BR /&gt;Note:- "TitleString" is the column name.
&lt;BR /&gt;--
&lt;BR /&gt;Regards,
&lt;BR /&gt;Vinod</description>
      <pubDate>Fri, 31 Aug 2012 08:20:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Converting-strings-into-proper-title-case-using-Java/m-p/2215067#M11640</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-08-31T08:20:30Z</dc:date>
    </item>
  </channel>
</rss>

