<?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: Transform a rdi file into a xml file in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/Transform-a-rdi-file-into-a-xml-file/m-p/2249605#M34099</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Of course !&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So first, I used a tFilterRow to retrieve on the fields that interest me.&lt;/P&gt;
&lt;P&gt;On advanced mode, I put this code (don't forget the space after field name) :&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;input_row.newColumn.contains("H046A")&lt;BR /&gt;||input_row.newColumn.contains("B_TITLE ")&lt;BR /&gt;||input_row.newColumn.contains("B_LASTNAME ")&lt;BR /&gt;||input_row.newColumn.contains("B_FIRTSNAME&amp;nbsp;")&lt;BR /&gt;||input_row.newColumn.contains("B_STREET ")&lt;BR /&gt;||input_row.newColumn.contains("B_POSTCODE ")&lt;BR /&gt;||input_row.newColumn.contains("B_CITY ")&lt;BR /&gt;||input_row.newColumn.contains("CRDI-CONTROL %%LINES-END FIN_DOCUMENT")&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then&amp;nbsp;I used a tReplace component with the following regexp :&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Pattern :&amp;nbsp;"H046A.*"&lt;/P&gt;
&lt;P&gt;Replaced with :&amp;nbsp;"&amp;lt;Document&amp;gt;"&lt;/P&gt;
&lt;P&gt;Description : H046A is a tag that identifies&amp;nbsp;the beginning of a document inside a whole batch rdi spool&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Pattern :&amp;nbsp;"CRDI-CONTROL %%LINES-END FIN_DOCUMENT TEXT ST FR"&lt;/P&gt;
&lt;P&gt;Replaced with : "&amp;lt;/Document&amp;gt;"&lt;/P&gt;
&lt;P&gt;Description : this pattern identifies the ending of a document &lt;SPAN&gt;inside a whole batch rdi spool&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Pattern :&amp;nbsp;"DMAIN.{36}(.{131}).{3}(.*)"&lt;/P&gt;
&lt;P&gt;Replaced with :&amp;nbsp;"\t&amp;lt;$1&amp;gt;$2&amp;lt;/$1&amp;gt;"&lt;/P&gt;
&lt;P&gt;Description : this pattern extracts the name and the value of a field inside the rdi spool according the following structure :&lt;/P&gt;
&lt;P&gt;- column 1 to 41 (41 columns) : field prefix with DMAIN and 36 spaces&amp;nbsp;&lt;/P&gt;
&lt;P&gt;- column 42 to 172 (131 columns) : field name with spaces after&lt;/P&gt;
&lt;P&gt;- column 173 to 175 (3 columns) : field value size&lt;/P&gt;
&lt;P&gt;- columns 176 to the end of line : field value&lt;/P&gt;
&lt;P&gt;This we retrieve field name in $1 and field value in $2&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Pattern : "&amp;nbsp; "&lt;/P&gt;
&lt;P&gt;Replaced with : ""&lt;/P&gt;
&lt;P&gt;Description : in order to delete spaces in field name&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Pattern :&amp;nbsp;" &amp;gt;"&lt;/P&gt;
&lt;P&gt;Replaced with : "&amp;gt;"&lt;/P&gt;
&lt;P&gt;Description : in order to delete some remaining spaces&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Pattern :&amp;nbsp;"B_TITLE"&lt;/P&gt;
&lt;P&gt;Replaced with : "title"&lt;/P&gt;
&lt;P&gt;Description : in order to rename field (you can do the same for B_LASTNAME, B_FIRSTNAME, ...)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And that's it.&lt;/P&gt;
&lt;P&gt;I hope it's understandable.&lt;/P&gt;
&lt;P&gt;If there is a better or easier solution, I'm interested !&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;</description>
    <pubDate>Mon, 03 Sep 2018 11:01:38 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2018-09-03T11:01:38Z</dc:date>
    <item>
      <title>Transform a rdi file into a xml file</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Transform-a-rdi-file-into-a-xml-file/m-p/2249601#M34095</link>
      <description>&lt;P&gt;Hi everybody,&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;I'm a total newbie&amp;nbsp;on Talend and I'm trying to transform a rdi file into a xml file.&lt;/P&gt; 
&lt;P&gt;What is a rdi file ? It's a text file coming from SAP (RDI = Row Data Interface)&lt;/P&gt; 
&lt;P&gt;Its structure is columns fixed, here below is a sample :&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&lt;FONT size="2" face="courier new,courier"&gt;H046A011000000653776FZSCRIPT_FACTURE PRINTER&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt; 
&lt;P&gt;&lt;FONT size="2" face="courier new,courier"&gt;DMAIN&amp;nbsp; &amp;nbsp; XX&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; B_TITLE&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;002MR&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2" face="courier new,courier"&gt;DMAIN&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; B_LASTNAME&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 003DOE&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2" face="courier new,courier"&gt;DMAIN&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; B_FIRSTNAME&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;004John&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2" face="courier new,courier"&gt;DMAIN&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; B_STREET&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 0231 RUE DE LA TOUR EIFFEL&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2" face="courier new,courier"&gt;DMAIN&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; B_POSTCODE&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 00575000&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2" face="courier new,courier"&gt;DMAIN&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; B_CITY&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 005PARIS&lt;/FONT&gt;&lt;/P&gt; 
&lt;P&gt;&lt;FONT size="2" face="courier new,courier"&gt;H046A011000000653776FZSCRIPT_FACTURE PRINTER&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt; 
&lt;P&gt;&lt;FONT size="2" face="courier new,courier"&gt;DMAIN&amp;nbsp; &amp;nbsp; XX&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; B_TITLE&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;002MME&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2" face="courier new,courier"&gt;DMAIN&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; B_LASTNAME&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 003DOE&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2" face="courier new,courier"&gt;DMAIN&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; B_FIRSTNAME&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;004Jane&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2" face="courier new,courier"&gt;DMAIN&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; B_STREET&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 0233 RUE DES CHAMPS ELYSEES&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2" face="courier new,courier"&gt;DMAIN&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; B_POSTCODE&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 00575000&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2" face="courier new,courier"&gt;DMAIN&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; B_CITY&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 005PARIS&lt;/FONT&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;You can see a structure like this :&lt;/P&gt; 
&lt;P&gt;- prefix&lt;/P&gt; 
&lt;P&gt;- field&lt;/P&gt; 
&lt;P&gt;- size&lt;/P&gt; 
&lt;P&gt;- value&lt;/P&gt; 
&lt;P&gt;Forthermore, you can have more than 1 record in a single rdi file.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Now, what I would like in XML output would be like this :&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;lt;Documents&amp;gt;&lt;BR /&gt;&amp;lt;Document&amp;gt;&lt;BR /&gt;&amp;lt;title&amp;gt;MR&amp;lt;/title&amp;gt;&lt;BR /&gt;&amp;lt;lastname&amp;gt;DOE&amp;lt;/lastname&amp;gt;&lt;BR /&gt;&amp;lt;firstname&amp;gt;John&amp;lt;/firstname&amp;gt;&lt;BR /&gt;&amp;lt;/Document&amp;gt;&lt;BR /&gt;&amp;lt;Document&amp;gt;&lt;BR /&gt;&amp;lt;title&amp;gt;MME&amp;lt;/title&amp;gt;&lt;BR /&gt;&amp;lt;lastname&amp;gt;DOE&amp;lt;/lastname&amp;gt;&lt;BR /&gt;&amp;lt;firstname&amp;gt;Jane&amp;lt;/firstname&amp;gt;&lt;BR /&gt;&amp;lt;/Document&amp;gt;&lt;BR /&gt;&amp;lt;/Documents&amp;gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;I've used tFileList, tFileInputPositional, tFilterRow, tMap and tFileOutputXML components.&lt;/P&gt; 
&lt;P&gt;On tFilterRow, I've added these conditions :&lt;/P&gt; 
&lt;P&gt;- field = B_TITRE or field = B_LASTNAME or field = B_FIRSTNAME&lt;/P&gt; 
&lt;P&gt;These on tMap I've mapped fieldnames :&lt;/P&gt; 
&lt;P&gt;- B_TITLE with title&lt;/P&gt; 
&lt;P&gt;- B_LASTNAME with lastname&lt;/P&gt; 
&lt;P&gt;- B_FIRSTNAME with firstname&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Unfortunately I did no succeed in naming output xml fields.&lt;/P&gt; 
&lt;P&gt;I've this :&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;lt;Documents&amp;gt;&lt;BR /&gt;&amp;lt;Document&amp;gt;&lt;BR /&gt;&amp;lt;field&amp;gt;B_TITLE&amp;lt;/&lt;SPAN&gt;field&lt;/SPAN&gt;&amp;gt;&lt;BR /&gt;&amp;lt;value&amp;gt;MR&amp;lt;/&lt;SPAN&gt;value&lt;/SPAN&gt;&amp;gt;&lt;BR /&gt;&amp;lt;/Document&amp;gt;&lt;BR /&gt;&amp;lt;Document&amp;gt;&lt;BR /&gt;&amp;lt;&lt;SPAN&gt;field&lt;/SPAN&gt;&amp;gt;&lt;SPAN&gt;B_LASTNAME&lt;/SPAN&gt;&amp;lt;/&lt;SPAN&gt;field&lt;/SPAN&gt;&amp;gt;&lt;BR /&gt;&amp;lt;&lt;SPAN&gt;value&lt;/SPAN&gt;&amp;gt;DOE&amp;lt;/&lt;SPAN&gt;value&lt;/SPAN&gt;&amp;gt;&lt;BR /&gt;&amp;lt;/Document&amp;gt;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN&gt;&amp;lt;Document&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN&gt;field&lt;/SPAN&gt;&lt;SPAN&gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN&gt;B_FIRSTNAME&lt;/SPAN&gt;&lt;SPAN&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN&gt;field&lt;/SPAN&gt;&lt;SPAN&gt;&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN&gt;value&lt;/SPAN&gt;&lt;SPAN&gt;&amp;gt;John&amp;lt;/&lt;/SPAN&gt;&lt;SPAN&gt;value&lt;/SPAN&gt;&lt;SPAN&gt;&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;/Document&amp;gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&amp;lt;Document&amp;gt;&lt;BR /&gt;&amp;lt;field&amp;gt;B_TITLE&amp;lt;/&lt;SPAN&gt;field&lt;/SPAN&gt;&amp;gt;&lt;BR /&gt;&amp;lt;value&amp;gt;MME&amp;lt;/&lt;SPAN&gt;value&lt;/SPAN&gt;&amp;gt;&lt;BR /&gt;&amp;lt;/Document&amp;gt;&lt;BR /&gt;&amp;lt;Document&amp;gt;&lt;BR /&gt;&amp;lt;&lt;SPAN&gt;field&lt;/SPAN&gt;&amp;gt;&lt;SPAN&gt;B_LASTNAME&lt;/SPAN&gt;&amp;lt;/&lt;SPAN&gt;field&lt;/SPAN&gt;&amp;gt;&lt;BR /&gt;&amp;lt;&lt;SPAN&gt;value&lt;/SPAN&gt;&amp;gt;DOE&amp;lt;/&lt;SPAN&gt;value&lt;/SPAN&gt;&amp;gt;&lt;BR /&gt;&amp;lt;/Document&amp;gt;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN&gt;&amp;lt;Document&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN&gt;field&lt;/SPAN&gt;&lt;SPAN&gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN&gt;B_FIRSTNAME&lt;/SPAN&gt;&lt;SPAN&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN&gt;field&lt;/SPAN&gt;&lt;SPAN&gt;&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN&gt;value&lt;/SPAN&gt;&lt;SPAN&gt;&amp;gt;Jane&amp;lt;/&lt;/SPAN&gt;&lt;SPAN&gt;value&lt;/SPAN&gt;&lt;SPAN&gt;&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;/Document&amp;gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN&gt;&amp;lt;/Documents&amp;gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Thank you for your help !&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Nicolas&lt;/P&gt;</description>
      <pubDate>Thu, 30 Aug 2018 11:01:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Transform-a-rdi-file-into-a-xml-file/m-p/2249601#M34095</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-08-30T11:01:30Z</dc:date>
    </item>
    <item>
      <title>Re: Transform a rdi file into a xml file</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Transform-a-rdi-file-into-a-xml-file/m-p/2249602#M34096</link>
      <description>you have to use tDenormalize to have one row by documents.</description>
      <pubDate>Thu, 30 Aug 2018 13:36:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Transform-a-rdi-file-into-a-xml-file/m-p/2249602#M34096</guid>
      <dc:creator>fdenis</dc:creator>
      <dc:date>2018-08-30T13:36:32Z</dc:date>
    </item>
    <item>
      <title>Re: Transform a rdi file into a xml file</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Transform-a-rdi-file-into-a-xml-file/m-p/2249603#M34097</link>
      <description>&lt;P&gt;Thank for your reply François.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Finally, I've used a tFileInputDelimited and a&amp;nbsp;tReplace with regexp to retrieve fields.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;</description>
      <pubDate>Fri, 31 Aug 2018 10:59:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Transform-a-rdi-file-into-a-xml-file/m-p/2249603#M34097</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-08-31T10:59:46Z</dc:date>
    </item>
    <item>
      <title>Re: Transform a rdi file into a xml file</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Transform-a-rdi-file-into-a-xml-file/m-p/2249604#M34098</link>
      <description>&lt;P&gt;Hello &lt;SPAN class="UserName lia-user-name lia-user-rank-Four-Stars lia-component-message-view-widget-author-username"&gt;&lt;A id="link_7" class="lia-link-navigation lia-page-link lia-user-name-link" href="https://community.qlik.com/s/profile/0053p000007LOjLAAW" target="_self"&gt;@nhalicka&lt;/A&gt;&lt;/SPAN&gt;,&lt;/P&gt; 
&lt;P&gt;Would you mind sharing your regexp in tReplace component on forum?&lt;/P&gt; 
&lt;P&gt;We will appreciate it a lot.&lt;/P&gt; 
&lt;P&gt;Best regards&lt;/P&gt; 
&lt;P&gt;Sabrina&lt;/P&gt;</description>
      <pubDate>Mon, 03 Sep 2018 07:49:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Transform-a-rdi-file-into-a-xml-file/m-p/2249604#M34098</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-09-03T07:49:04Z</dc:date>
    </item>
    <item>
      <title>Re: Transform a rdi file into a xml file</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Transform-a-rdi-file-into-a-xml-file/m-p/2249605#M34099</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Of course !&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So first, I used a tFilterRow to retrieve on the fields that interest me.&lt;/P&gt;
&lt;P&gt;On advanced mode, I put this code (don't forget the space after field name) :&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;input_row.newColumn.contains("H046A")&lt;BR /&gt;||input_row.newColumn.contains("B_TITLE ")&lt;BR /&gt;||input_row.newColumn.contains("B_LASTNAME ")&lt;BR /&gt;||input_row.newColumn.contains("B_FIRTSNAME&amp;nbsp;")&lt;BR /&gt;||input_row.newColumn.contains("B_STREET ")&lt;BR /&gt;||input_row.newColumn.contains("B_POSTCODE ")&lt;BR /&gt;||input_row.newColumn.contains("B_CITY ")&lt;BR /&gt;||input_row.newColumn.contains("CRDI-CONTROL %%LINES-END FIN_DOCUMENT")&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then&amp;nbsp;I used a tReplace component with the following regexp :&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Pattern :&amp;nbsp;"H046A.*"&lt;/P&gt;
&lt;P&gt;Replaced with :&amp;nbsp;"&amp;lt;Document&amp;gt;"&lt;/P&gt;
&lt;P&gt;Description : H046A is a tag that identifies&amp;nbsp;the beginning of a document inside a whole batch rdi spool&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Pattern :&amp;nbsp;"CRDI-CONTROL %%LINES-END FIN_DOCUMENT TEXT ST FR"&lt;/P&gt;
&lt;P&gt;Replaced with : "&amp;lt;/Document&amp;gt;"&lt;/P&gt;
&lt;P&gt;Description : this pattern identifies the ending of a document &lt;SPAN&gt;inside a whole batch rdi spool&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Pattern :&amp;nbsp;"DMAIN.{36}(.{131}).{3}(.*)"&lt;/P&gt;
&lt;P&gt;Replaced with :&amp;nbsp;"\t&amp;lt;$1&amp;gt;$2&amp;lt;/$1&amp;gt;"&lt;/P&gt;
&lt;P&gt;Description : this pattern extracts the name and the value of a field inside the rdi spool according the following structure :&lt;/P&gt;
&lt;P&gt;- column 1 to 41 (41 columns) : field prefix with DMAIN and 36 spaces&amp;nbsp;&lt;/P&gt;
&lt;P&gt;- column 42 to 172 (131 columns) : field name with spaces after&lt;/P&gt;
&lt;P&gt;- column 173 to 175 (3 columns) : field value size&lt;/P&gt;
&lt;P&gt;- columns 176 to the end of line : field value&lt;/P&gt;
&lt;P&gt;This we retrieve field name in $1 and field value in $2&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Pattern : "&amp;nbsp; "&lt;/P&gt;
&lt;P&gt;Replaced with : ""&lt;/P&gt;
&lt;P&gt;Description : in order to delete spaces in field name&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Pattern :&amp;nbsp;" &amp;gt;"&lt;/P&gt;
&lt;P&gt;Replaced with : "&amp;gt;"&lt;/P&gt;
&lt;P&gt;Description : in order to delete some remaining spaces&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Pattern :&amp;nbsp;"B_TITLE"&lt;/P&gt;
&lt;P&gt;Replaced with : "title"&lt;/P&gt;
&lt;P&gt;Description : in order to rename field (you can do the same for B_LASTNAME, B_FIRSTNAME, ...)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And that's it.&lt;/P&gt;
&lt;P&gt;I hope it's understandable.&lt;/P&gt;
&lt;P&gt;If there is a better or easier solution, I'm interested !&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;</description>
      <pubDate>Mon, 03 Sep 2018 11:01:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Transform-a-rdi-file-into-a-xml-file/m-p/2249605#M34099</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-09-03T11:01:38Z</dc:date>
    </item>
  </channel>
</rss>

