<?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: Add leading zero's in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/Add-leading-zero-s/m-p/2372293#M135147</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Hi&lt;BR /&gt;If you want to have a value like "078", you have to change this column as String.&lt;BR /&gt;Regards,&lt;BR /&gt;Pedro&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;Thanks; forgot to mention, the column IS a string.</description>
    <pubDate>Mon, 16 Jan 2012 10:17:45 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2012-01-16T10:17:45Z</dc:date>
    <item>
      <title>Add leading zero's</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Add-leading-zero-s/m-p/2372291#M135145</link>
      <description>I have a text file containing a column "ID". Please see example below. The ID should be an integer with length 3. Now the problem is that some records have values which are two digits long. Is it possible to (in case the length is not three) add leading zero's, just to make it length(3)? I know this is possible with a custom java code (component), however I would like to fix this with a regular expression replace. Anyone some suggestions?
&lt;BR /&gt;"ID","TITLE"
&lt;BR /&gt;"123","Title 1"
&lt;BR /&gt;"456","Title 2"
&lt;BR /&gt;"78","Title 3"</description>
      <pubDate>Sat, 16 Nov 2024 12:27:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Add-leading-zero-s/m-p/2372291#M135145</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-11-16T12:27:01Z</dc:date>
    </item>
    <item>
      <title>Re: Add leading zero's</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Add-leading-zero-s/m-p/2372292#M135146</link>
      <description>Hi&lt;BR /&gt;If you want to have a value like "078", you have to change this column as String.&lt;BR /&gt;Regards,&lt;BR /&gt;Pedro</description>
      <pubDate>Mon, 16 Jan 2012 10:16:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Add-leading-zero-s/m-p/2372292#M135146</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-01-16T10:16:53Z</dc:date>
    </item>
    <item>
      <title>Re: Add leading zero's</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Add-leading-zero-s/m-p/2372293#M135147</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Hi&lt;BR /&gt;If you want to have a value like "078", you have to change this column as String.&lt;BR /&gt;Regards,&lt;BR /&gt;Pedro&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;Thanks; forgot to mention, the column IS a string.</description>
      <pubDate>Mon, 16 Jan 2012 10:17:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Add-leading-zero-s/m-p/2372293#M135147</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-01-16T10:17:45Z</dc:date>
    </item>
    <item>
      <title>Re: Add leading zero's</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Add-leading-zero-s/m-p/2372294#M135148</link>
      <description>I use :&lt;BR /&gt;String.format("%3s", &amp;lt;your field&amp;gt; ).replaceAll(" ", "0")</description>
      <pubDate>Mon, 16 Jan 2012 11:01:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Add-leading-zero-s/m-p/2372294#M135148</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-01-16T11:01:43Z</dc:date>
    </item>
    <item>
      <title>Re: Add leading zero's</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Add-leading-zero-s/m-p/2372295#M135149</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;I use :&lt;BR /&gt;String.format("%3s", &amp;lt;your field&amp;gt; ).replaceAll(" ", "0")&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;Thanks! Little improvement to your code:&lt;BR /&gt;String.format("%03d", Int.parseInt(row7.ID));&lt;BR /&gt;This will add "0"'s to your integer, with a maximum of 3 digits long.</description>
      <pubDate>Mon, 16 Jan 2012 11:24:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Add-leading-zero-s/m-p/2372295#M135149</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-01-16T11:24:07Z</dc:date>
    </item>
    <item>
      <title>Re: Add leading zero's</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Add-leading-zero-s/m-p/2372296#M135150</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I also have the same doubt and try to get the desired output but get an error (Int cannot be resolved). So, I tried this: &lt;/P&gt;&lt;P&gt;&lt;B&gt;String.format("%3d", Integer.parseInt(&amp;lt;your field&amp;gt;)) &lt;/B&gt;&lt;/P&gt;&lt;P&gt;and it worked out successfully.&lt;/P&gt;</description>
      <pubDate>Tue, 20 Sep 2022 08:33:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Add-leading-zero-s/m-p/2372296#M135150</guid>
      <dc:creator>KrishnaApurva</dc:creator>
      <dc:date>2022-09-20T08:33:16Z</dc:date>
    </item>
  </channel>
</rss>

