<?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: regexp &amp;quot;\n&amp;quot; in treplace in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/regexp-quot-n-quot-in-treplace/m-p/2233557#M23195</link>
    <description>Hi,
&lt;BR /&gt;
&lt;BLOCKQUOTE&gt;
 &lt;TABLE border="1"&gt;
  &lt;TBODY&gt;
   &lt;TR&gt;
    &lt;TD&gt;Ok, I found your problem, this a DOS file with \r\n (not only \n):&lt;BR /&gt;&lt;PRE&gt;        String string = "test1\r\n\r\ntest2";&lt;BR /&gt;        System.out.println("original:" + string);;&lt;BR /&gt;        System.out.println("1:" + string.replaceAll("\n", " "));&lt;BR /&gt;        System.out.println("2:" + string.replaceAll("\\n", " "));&lt;BR /&gt;        System.out.println("3:" + string.replaceAll("\\\n", " "));&lt;BR /&gt;        System.out.println("4:" + string.replaceAll("\\\\n", " "));&lt;BR /&gt;        System.out.println("5:" + string.replaceAll("\r\n", " "));&lt;BR /&gt;        System.out.println("6:" + string.replaceAll("(\r\n)+", " "));&lt;/PRE&gt;&lt;BR /&gt;give:&lt;BR /&gt;&lt;PRE&gt;original:test1&lt;BR /&gt;test2&lt;BR /&gt;1:test1&lt;BR /&gt; &lt;BR /&gt; test2&lt;BR /&gt;2:test1&lt;BR /&gt; &lt;BR /&gt; test2&lt;BR /&gt;3:test1&lt;BR /&gt; &lt;BR /&gt; test2&lt;BR /&gt;4:test1&lt;BR /&gt;test2&lt;BR /&gt;5:test1  test2&lt;BR /&gt;5:test1 test2&lt;/PRE&gt;&lt;BR /&gt;So the best pattern to use is:&lt;BR /&gt;&lt;PRE&gt;(\r\n)+&lt;/PRE&gt;&lt;BR /&gt;&lt;/TD&gt;
   &lt;/TR&gt;
  &lt;/TBODY&gt;
 &lt;/TABLE&gt;
&lt;/BLOCKQUOTE&gt;
&lt;BR /&gt;Referring to no 5. How to remove space in between the test1 and test2? Instead of "test1 test2". I want it to be "test1test2". I have similar problem like this.
&lt;BR /&gt;Thanks in advance!</description>
    <pubDate>Wed, 09 Jan 2013 02:21:28 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2013-01-09T02:21:28Z</dc:date>
    <item>
      <title>regexp "\n" in treplace</title>
      <link>https://community.qlik.com/t5/Talend-Studio/regexp-quot-n-quot-in-treplace/m-p/2233550#M23188</link>
      <description>Hello, 
&lt;BR /&gt;I have to move from a string field all the "\n". 
&lt;BR /&gt;I have tried the EREPLACE and the CHANGE fonctions in tMap but the half run: the "\n" is reached but not replaced and the replace string is added after the "\n". 
&lt;BR /&gt;Then I have tried the tReplace, but I have the same problem. 
&lt;BR /&gt; 
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MCab.jpg"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/149233i4C4EE9FF158082C8/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MCab.jpg" alt="0683p000009MCab.jpg" /&gt;&lt;/span&gt;</description>
      <pubDate>Sat, 16 Nov 2024 14:18:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/regexp-quot-n-quot-in-treplace/m-p/2233550#M23188</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-11-16T14:18:48Z</dc:date>
    </item>
    <item>
      <title>Re: regexp "\n" in treplace</title>
      <link>https://community.qlik.com/t5/Talend-Studio/regexp-quot-n-quot-in-treplace/m-p/2233551#M23189</link>
      <description>Hello
&lt;BR /&gt;If you want to replace a character you can use this function : yourtable.yourfield.replaceAll("\\\n", " "); 
&lt;BR /&gt;With that all "\n" will be replace by " "
&lt;BR /&gt;the \\ is needed to make correctly this operation. I hope that will works</description>
      <pubDate>Wed, 02 Jul 2008 15:38:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/regexp-quot-n-quot-in-treplace/m-p/2233551#M23189</guid>
      <dc:creator>_AnonymousUser</dc:creator>
      <dc:date>2008-07-02T15:38:41Z</dc:date>
    </item>
    <item>
      <title>Re: regexp "\n" in treplace</title>
      <link>https://community.qlik.com/t5/Talend-Studio/regexp-quot-n-quot-in-treplace/m-p/2233552#M23190</link>
      <description>Hello
&lt;BR /&gt;If you want to replace a character you can use this function : yourtable.yourfield.replaceAll("\\\n", " "); 
&lt;BR /&gt;With that all "\n" will be replace by " "
&lt;BR /&gt;I did that with Tmap but I don't know if it works with others components
&lt;BR /&gt;the \\ is needed to make correctly this operation. I hope that will works</description>
      <pubDate>Wed, 02 Jul 2008 15:40:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/regexp-quot-n-quot-in-treplace/m-p/2233552#M23190</guid>
      <dc:creator>_AnonymousUser</dc:creator>
      <dc:date>2008-07-02T15:40:21Z</dc:date>
    </item>
    <item>
      <title>Re: regexp "\n" in treplace</title>
      <link>https://community.qlik.com/t5/Talend-Studio/regexp-quot-n-quot-in-treplace/m-p/2233553#M23191</link>
      <description>In fact several syntaxes seems to work:&lt;BR /&gt;&lt;PRE&gt;        String string = "test1\ntest2";&lt;BR /&gt;        System.out.println("original:" + string);;&lt;BR /&gt;        System.out.println("1:" + "test1\ntest2".replaceAll("\n", " "));;&lt;BR /&gt;        System.out.println("2:" + "test1\ntest2".replaceAll("\\n", " "));;&lt;BR /&gt;        System.out.println("3:" + "test1\ntest2".replaceAll("\\\n", " "));;&lt;BR /&gt;        System.out.println("4:" + "test1\ntest2".replaceAll("\\\\n", " "));;&lt;/PRE&gt;&lt;BR /&gt;give result:&lt;BR /&gt;&lt;PRE&gt;original:test1&lt;BR /&gt;test2&lt;BR /&gt;1:test1 test2&lt;BR /&gt;2:test1 test2&lt;BR /&gt;3:test1 test2&lt;BR /&gt;4:test1&lt;BR /&gt;test2&lt;/PRE&gt;</description>
      <pubDate>Wed, 02 Jul 2008 15:57:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/regexp-quot-n-quot-in-treplace/m-p/2233553#M23191</guid>
      <dc:creator>amaumont</dc:creator>
      <dc:date>2008-07-02T15:57:04Z</dc:date>
    </item>
    <item>
      <title>Re: regexp "\n" in treplace</title>
      <link>https://community.qlik.com/t5/Talend-Studio/regexp-quot-n-quot-in-treplace/m-p/2233554#M23192</link>
      <description>I'm sorry but it doesn't work! 
&lt;BR /&gt;See datas please: 
&lt;BR /&gt;In the second image, you can see the input data. || is the \n. 
&lt;BR /&gt;In the third image, you can see the tMap function I use 
&lt;BR /&gt;In the first image the result. 
&lt;BR /&gt; 
&lt;BR /&gt;You see that The job has found the \n but hasn't replace it. The job has added the space after the \n. 
&lt;BR /&gt;What is the problem in my job? 
&lt;BR /&gt;Thanks for reply. 
&lt;BR /&gt; 
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MCag.jpg"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/131857iA6559646C9FF9500/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MCag.jpg" alt="0683p000009MCag.jpg" /&gt;&lt;/span&gt; 
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MCal.jpg"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/147927i9ACC39B9E9105395/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MCal.jpg" alt="0683p000009MCal.jpg" /&gt;&lt;/span&gt; 
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MCBo.jpg"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/157229iA1EE95549E61C204/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MCBo.jpg" alt="0683p000009MCBo.jpg" /&gt;&lt;/span&gt;</description>
      <pubDate>Wed, 02 Jul 2008 18:15:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/regexp-quot-n-quot-in-treplace/m-p/2233554#M23192</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2008-07-02T18:15:02Z</dc:date>
    </item>
    <item>
      <title>Re: regexp "\n" in treplace</title>
      <link>https://community.qlik.com/t5/Talend-Studio/regexp-quot-n-quot-in-treplace/m-p/2233555#M23193</link>
      <description>Ok, I found your problem, this a DOS file with \r\n (not only \n):&lt;BR /&gt;&lt;PRE&gt;        String string = "test1\r\n\r\ntest2";&lt;BR /&gt;        System.out.println("original:" + string);;&lt;BR /&gt;        System.out.println("1:" + string.replaceAll("\n", " "));&lt;BR /&gt;        System.out.println("2:" + string.replaceAll("\\n", " "));&lt;BR /&gt;        System.out.println("3:" + string.replaceAll("\\\n", " "));&lt;BR /&gt;        System.out.println("4:" + string.replaceAll("\\\\n", " "));&lt;BR /&gt;        System.out.println("5:" + string.replaceAll("\r\n", " "));&lt;BR /&gt;        System.out.println("6:" + string.replaceAll("(\r\n)+", " "));&lt;/PRE&gt;&lt;BR /&gt;give:&lt;BR /&gt;&lt;PRE&gt;original:test1&lt;BR /&gt;test2&lt;BR /&gt;1:test1&lt;BR /&gt; &lt;BR /&gt; test2&lt;BR /&gt;2:test1&lt;BR /&gt; &lt;BR /&gt; test2&lt;BR /&gt;3:test1&lt;BR /&gt; &lt;BR /&gt; test2&lt;BR /&gt;4:test1&lt;BR /&gt;test2&lt;BR /&gt;5:test1  test2&lt;BR /&gt;5:test1 test2&lt;/PRE&gt;&lt;BR /&gt;So the best pattern to use is:&lt;BR /&gt;&lt;PRE&gt;(\r\n)+&lt;/PRE&gt;</description>
      <pubDate>Wed, 02 Jul 2008 20:49:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/regexp-quot-n-quot-in-treplace/m-p/2233555#M23193</guid>
      <dc:creator>amaumont</dc:creator>
      <dc:date>2008-07-02T20:49:44Z</dc:date>
    </item>
    <item>
      <title>Re: regexp "\n" in treplace</title>
      <link>https://community.qlik.com/t5/Talend-Studio/regexp-quot-n-quot-in-treplace/m-p/2233556#M23194</link>
      <description>Thanks very much.&lt;BR /&gt;It's running well.</description>
      <pubDate>Thu, 03 Jul 2008 10:56:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/regexp-quot-n-quot-in-treplace/m-p/2233556#M23194</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2008-07-03T10:56:11Z</dc:date>
    </item>
    <item>
      <title>Re: regexp "\n" in treplace</title>
      <link>https://community.qlik.com/t5/Talend-Studio/regexp-quot-n-quot-in-treplace/m-p/2233557#M23195</link>
      <description>Hi,
&lt;BR /&gt;
&lt;BLOCKQUOTE&gt;
 &lt;TABLE border="1"&gt;
  &lt;TBODY&gt;
   &lt;TR&gt;
    &lt;TD&gt;Ok, I found your problem, this a DOS file with \r\n (not only \n):&lt;BR /&gt;&lt;PRE&gt;        String string = "test1\r\n\r\ntest2";&lt;BR /&gt;        System.out.println("original:" + string);;&lt;BR /&gt;        System.out.println("1:" + string.replaceAll("\n", " "));&lt;BR /&gt;        System.out.println("2:" + string.replaceAll("\\n", " "));&lt;BR /&gt;        System.out.println("3:" + string.replaceAll("\\\n", " "));&lt;BR /&gt;        System.out.println("4:" + string.replaceAll("\\\\n", " "));&lt;BR /&gt;        System.out.println("5:" + string.replaceAll("\r\n", " "));&lt;BR /&gt;        System.out.println("6:" + string.replaceAll("(\r\n)+", " "));&lt;/PRE&gt;&lt;BR /&gt;give:&lt;BR /&gt;&lt;PRE&gt;original:test1&lt;BR /&gt;test2&lt;BR /&gt;1:test1&lt;BR /&gt; &lt;BR /&gt; test2&lt;BR /&gt;2:test1&lt;BR /&gt; &lt;BR /&gt; test2&lt;BR /&gt;3:test1&lt;BR /&gt; &lt;BR /&gt; test2&lt;BR /&gt;4:test1&lt;BR /&gt;test2&lt;BR /&gt;5:test1  test2&lt;BR /&gt;5:test1 test2&lt;/PRE&gt;&lt;BR /&gt;So the best pattern to use is:&lt;BR /&gt;&lt;PRE&gt;(\r\n)+&lt;/PRE&gt;&lt;BR /&gt;&lt;/TD&gt;
   &lt;/TR&gt;
  &lt;/TBODY&gt;
 &lt;/TABLE&gt;
&lt;/BLOCKQUOTE&gt;
&lt;BR /&gt;Referring to no 5. How to remove space in between the test1 and test2? Instead of "test1 test2". I want it to be "test1test2". I have similar problem like this.
&lt;BR /&gt;Thanks in advance!</description>
      <pubDate>Wed, 09 Jan 2013 02:21:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/regexp-quot-n-quot-in-treplace/m-p/2233557#M23195</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-01-09T02:21:28Z</dc:date>
    </item>
    <item>
      <title>Re: regexp "\n" in treplace</title>
      <link>https://community.qlik.com/t5/Talend-Studio/regexp-quot-n-quot-in-treplace/m-p/2233558#M23196</link>
      <description>Hi,&lt;BR /&gt;use "" and not " " in replaceAll : string.replaceAll("(\r\n)+", ""))&lt;BR /&gt;best regards&lt;BR /&gt;Jeremie</description>
      <pubDate>Wed, 09 Jan 2013 08:26:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/regexp-quot-n-quot-in-treplace/m-p/2233558#M23196</guid>
      <dc:creator>_AnonymousUser</dc:creator>
      <dc:date>2013-01-09T08:26:44Z</dc:date>
    </item>
  </channel>
</rss>

