<?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: Modify LogRow data with tJavaRow in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/Modify-LogRow-data-with-tJavaRow/m-p/2224266#M17044</link>
    <description>&lt;P&gt;I found the answer.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&lt;STRONG&gt;First&lt;/STRONG&gt;&lt;/P&gt; 
&lt;P&gt;It's necessary import all of&amp;nbsp;input schema and output schema&lt;/P&gt; 
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="modelRta1.PNG" style="width: 999px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M8PL.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/157038iA9035100AC2DDF77/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M8PL.png" alt="0683p000009M8PL.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&lt;STRONG&gt;Second&lt;/STRONG&gt;&lt;/P&gt; 
&lt;P&gt;Assign directly the value of the row through a StringBuilder object.&lt;/P&gt; 
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="modelRta2.PNG" style="width: 760px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M7rD.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/151584i9DA3882FA3568B6B/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M7rD.png" alt="0683p000009M7rD.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&lt;STRONG&gt;Finally&lt;/STRONG&gt;&lt;/P&gt; 
&lt;P&gt;And I got my XML file according to the modifed routine.&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Cheers!&lt;/P&gt;</description>
    <pubDate>Fri, 20 Dec 2019 11:38:36 GMT</pubDate>
    <dc:creator>alex2020</dc:creator>
    <dc:date>2019-12-20T11:38:36Z</dc:date>
    <item>
      <title>Modify LogRow data with tJavaRow</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Modify-LogRow-data-with-tJavaRow/m-p/2224265#M17043</link>
      <description>&lt;P&gt;Hi everyone,&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;I did a job where it :&lt;/P&gt; 
&lt;P&gt;* Extracts an email from a IMAP server using&amp;nbsp;&lt;STRONG&gt;tPOP&lt;/STRONG&gt;&lt;/P&gt; 
&lt;P&gt;* Iterates and reads the email using&amp;nbsp;&lt;STRONG&gt;tFileList&lt;/STRONG&gt; and &lt;STRONG&gt;tFileInputMail&lt;/STRONG&gt;&lt;/P&gt; 
&lt;P&gt;* Prints the results of the params of the tFileInputMail component with &lt;STRONG&gt;tLogRow&lt;/STRONG&gt;&lt;/P&gt; 
&lt;P&gt;&lt;STRONG&gt;*&amp;nbsp;&lt;/STRONG&gt;Creates an XML with the params of the tFileInputMail output.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;I got the next model:&lt;/P&gt; 
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="model.PNG" style="width: 952px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M82Y.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/131294i8667B12D687A94F0/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M82Y.png" alt="0683p000009M82Y.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Everything is working fine (There's no code at tJavaRow yet ). But as almost of the software projects, the requirements have changed.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Now, I need to create an XML based on my extracted email. I need extract the a regex for &lt;STRONG&gt;Content/body&lt;/STRONG&gt; tag of the MailPart of the tFileInputMail component.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&lt;EM&gt;The Mail part required:&lt;/EM&gt;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="model2.PNG" style="width: 999px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M7nN.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/137857i5B15BD4B162731CE/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M7nN.png" alt="0683p000009M7nN.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&lt;EM&gt;The regex required (in Java code):&lt;/EM&gt;&lt;/P&gt; 
&lt;PRE&gt;"(\\#Location.*?\\;)|(\\#City.*?\\;)"&lt;/PRE&gt; 
&lt;P&gt;I'm using a &lt;STRONG&gt;tJavaRow&lt;/STRONG&gt; component in order to modify the content of the tag as follow:&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="model3.PNG" style="width: 999px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M8Fq.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/129877i590A3FFBA40F262C/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M8Fq.png" alt="0683p000009M8Fq.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;code:&lt;/P&gt; 
&lt;PRE&gt;//Code generated according to input schema and output schema
output_row.Content = input_row.Content;


String data =  String.valueOf(output_row.Content);

if (data!= null) {
	Pattern pattern = Pattern.compile("(\\#Location.*?\\;)|(\\#Area.*?\\;)");
	Matcher matcher = pattern.matcher(data);
	
	while(matcher.find()) {
	    	 int i =0;
	    	 //System.out.println(matcher.group(i)+"\n");
			 row3.Content.replaceAll("(\\#Location.*?\\;)|(\\#Area.*?\\;)", matcher.group(i));

	    	 i++;
	    	 
	}
}&lt;/PRE&gt; 
&lt;P&gt;But is not possible to change the Content attribute of the row3. At row3, I can see the String that I want to replace for the result of the regex (regex is working fine) but no modify or replace it.&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;How can I change this data? Is it possible?&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Thanks and regards!&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;P.S.: Additional information:&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;1. The email original content/body (row3.Content original content that I can see)&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;PRE&gt;&amp;lt;html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"&amp;gt;

&amp;lt;head&amp;gt;

&amp;lt;meta http-equiv="Content-Type" content="text/html; charset=us-ascii"&amp;gt;

&amp;lt;meta name="Generator" content="Microsoft Word 15 (filtered medium)"&amp;gt;

&amp;lt;style&amp;gt;&amp;lt;!--

/* Font Definitions */

@font-face

	{font-family:"Cambria Math";

	panose-1:2 4 5 3 5 4 6 3 2 4;}

@font-face

	{font-family:Calibri;

	panose-1:2 15 5 2 2 2 4 3 2 4;}

/* Style Definitions */

p.MsoNormal, li.MsoNormal, div.MsoNormal

	{margin:0cm;

	margin-bottom:.0001pt;

	font-size:11.0pt;

	font-family:"Calibri",sans-serif;

	mso-fareast-language:EN-US;}

a:link, span.MsoHyperlink

	{mso-style-priority:99;

	color:#0563C1;

	text-decoration:underline;}

a:visited, span.MsoHyperlinkFollowed

	{mso-style-priority:99;

	color:#954F72;

	text-decoration:underline;}

span.EstiloCorreo17

	{mso-style-type:personal-compose;

	font-family:"Calibri",sans-serif;

	color:windowtext;}

.MsoChpDefault

	{mso-style-type:export-only;

	font-family:"Calibri",sans-serif;

	mso-fareast-language:EN-US;}

@page WordSection1

	{size:612.0pt 792.0pt;

	margin:70.85pt 3.0cm 70.85pt 3.0cm;}

div.WordSection1

	{page:WordSection1;}

--&amp;gt;&amp;lt;/style&amp;gt;&amp;lt;!--[if gte mso 9]&amp;gt;&amp;lt;xml&amp;gt;

&amp;lt;o:shapedefaults v:ext="edit" spidmax="1026" /&amp;gt;

&amp;lt;/xml&amp;gt;&amp;lt;![endif]--&amp;gt;&amp;lt;!--[if gte mso 9]&amp;gt;&amp;lt;xml&amp;gt;

&amp;lt;o:shapelayout v:ext="edit"&amp;gt;

&amp;lt;o:idmap v:ext="edit" data="1" /&amp;gt;

&amp;lt;/o:shapelayout&amp;gt;&amp;lt;/xml&amp;gt;&amp;lt;![endif]--&amp;gt;

&amp;lt;/head&amp;gt;

&amp;lt;body lang="ES" link="#0563C1" vlink="#954F72"&amp;gt;

&amp;lt;div class="WordSection1"&amp;gt;

&amp;lt;p class="MsoNormal" style="margin:11.25pt;text-align:justify"&amp;gt;Test&amp;lt;o:p&amp;gt;&amp;lt;/o:p&amp;gt;&amp;lt;/p&amp;gt;

&amp;lt;p class="MsoNormal" style="margin:11.25pt;text-align:justify"&amp;gt;#Area:AreaTest:;&amp;lt;o:p&amp;gt;&amp;lt;/o:p&amp;gt;&amp;lt;/p&amp;gt;

&amp;lt;p class="MsoNormal" style="margin:11.25pt;text-align:justify"&amp;gt;&amp;lt;o:p&amp;gt;&amp;amp;nbsp;&amp;lt;/o:p&amp;gt;&amp;lt;/p&amp;gt;

&amp;lt;p class="MsoNormal" style="margin:11.25pt;text-align:justify"&amp;gt;Other testing mesagges&amp;lt;span style="font-size:13.5pt;font-family:&amp;amp;quot;Times New Roman&amp;amp;quot;,serif;color:black;letter-spacing:.75pt;mso-fareast-language:ES"&amp;gt;&amp;lt;o:p&amp;gt;&amp;lt;/o:p&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/p&amp;gt;

&amp;lt;p class="MsoNormal"&amp;gt;&amp;lt;o:p&amp;gt;&amp;amp;nbsp;&amp;lt;/o:p&amp;gt;&amp;lt;/p&amp;gt;

&amp;lt;/div&amp;gt;

&amp;lt;/body&amp;gt;

&amp;lt;/html&amp;gt;&lt;/PRE&gt; 
&lt;P&gt;2. I just want in row3.Content the next result of the application of the regex rules.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;PRE&gt;#Area:AreaTest:;&lt;/PRE&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 03:46:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Modify-LogRow-data-with-tJavaRow/m-p/2224265#M17043</guid>
      <dc:creator>alex2020</dc:creator>
      <dc:date>2024-11-16T03:46:13Z</dc:date>
    </item>
    <item>
      <title>Re: Modify LogRow data with tJavaRow</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Modify-LogRow-data-with-tJavaRow/m-p/2224266#M17044</link>
      <description>&lt;P&gt;I found the answer.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&lt;STRONG&gt;First&lt;/STRONG&gt;&lt;/P&gt; 
&lt;P&gt;It's necessary import all of&amp;nbsp;input schema and output schema&lt;/P&gt; 
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="modelRta1.PNG" style="width: 999px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M8PL.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/157038iA9035100AC2DDF77/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M8PL.png" alt="0683p000009M8PL.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&lt;STRONG&gt;Second&lt;/STRONG&gt;&lt;/P&gt; 
&lt;P&gt;Assign directly the value of the row through a StringBuilder object.&lt;/P&gt; 
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="modelRta2.PNG" style="width: 760px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M7rD.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/151584i9DA3882FA3568B6B/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M7rD.png" alt="0683p000009M7rD.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&lt;STRONG&gt;Finally&lt;/STRONG&gt;&lt;/P&gt; 
&lt;P&gt;And I got my XML file according to the modifed routine.&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Cheers!&lt;/P&gt;</description>
      <pubDate>Fri, 20 Dec 2019 11:38:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Modify-LogRow-data-with-tJavaRow/m-p/2224266#M17044</guid>
      <dc:creator>alex2020</dc:creator>
      <dc:date>2019-12-20T11:38:36Z</dc:date>
    </item>
  </channel>
</rss>

