<?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: extract data from text file in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/extract-data-from-text-file/m-p/2329579#M98758</link>
    <description>This one is not as difficult as you may think. Here's a simplified example of one approach: 
&lt;BR /&gt; 
&lt;BR /&gt;Job Overview: 
&lt;BR /&gt; 
&lt;BR /&gt; 
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009ME93.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/148336iC8A0737C1F2ED7F5/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009ME93.png" alt="0683p000009ME93.png" /&gt;&lt;/span&gt; 
&lt;BR /&gt;code in tJavaRow_1 (note the default for context.read_data should be 
&lt;B&gt;false &lt;/B&gt;)&amp;nbsp; 
&lt;BR /&gt; 
&lt;PRE&gt;&lt;BR /&gt;if( input_row.line.matches("report data") ) {&lt;BR /&gt;	context.read_data = true;&lt;BR /&gt;}&lt;BR /&gt;if( input_row.line.matches("end report data") ) {&lt;BR /&gt;	context.read_data = false;&lt;BR /&gt;}&lt;BR /&gt;output_row.line = input_row.line;&lt;/PRE&gt; 
&lt;BR /&gt;Tmap: 
&lt;BR /&gt; 
&lt;BR /&gt; 
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009ME4d.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/129061i124B8293B090DCE8/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009ME4d.png" alt="0683p000009ME4d.png" /&gt;&lt;/span&gt; 
&lt;BR /&gt;Results: 
&lt;BR /&gt; 
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009ME98.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/131891iE87BB9A488BF4A6A/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009ME98.png" alt="0683p000009ME98.png" /&gt;&lt;/span&gt; 
&lt;BR /&gt;Test file:</description>
    <pubDate>Wed, 18 May 2016 22:25:49 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2016-05-18T22:25:49Z</dc:date>
    <item>
      <title>extract data from text file</title>
      <link>https://community.qlik.com/t5/Talend-Studio/extract-data-from-text-file/m-p/2329577#M98756</link>
      <description>I have a regular text file. I need to extract the block between "report data" and "end of report data":&amp;nbsp;
&lt;BR /&gt;text lines
&lt;BR /&gt;more and more lines
&lt;BR /&gt;............
&lt;BR /&gt;report data
&lt;BR /&gt;text line needed 1
&lt;BR /&gt;text line needed 2
&lt;BR /&gt;text line needed n
&lt;BR /&gt;end of report data
&lt;BR /&gt;............
&lt;BR /&gt;more and more lines
&lt;BR /&gt;What's the best way to approach this? An example would be really appreciated. Thank!</description>
      <pubDate>Wed, 18 May 2016 20:07:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/extract-data-from-text-file/m-p/2329577#M98756</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-05-18T20:07:46Z</dc:date>
    </item>
    <item>
      <title>Re: extract data from text file</title>
      <link>https://community.qlik.com/t5/Talend-Studio/extract-data-from-text-file/m-p/2329578#M98757</link>
      <description>Not that trivial. I suggest you read the lines line by line and aggregate them in a tJavaRow with a StringBuilder and check the lines for your marker lines. You will hardly find one building an example for that. This is a typical use case where we use plain java programming.</description>
      <pubDate>Wed, 18 May 2016 21:07:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/extract-data-from-text-file/m-p/2329578#M98757</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-05-18T21:07:24Z</dc:date>
    </item>
    <item>
      <title>Re: extract data from text file</title>
      <link>https://community.qlik.com/t5/Talend-Studio/extract-data-from-text-file/m-p/2329579#M98758</link>
      <description>This one is not as difficult as you may think. Here's a simplified example of one approach: 
&lt;BR /&gt; 
&lt;BR /&gt;Job Overview: 
&lt;BR /&gt; 
&lt;BR /&gt; 
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009ME93.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/148336iC8A0737C1F2ED7F5/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009ME93.png" alt="0683p000009ME93.png" /&gt;&lt;/span&gt; 
&lt;BR /&gt;code in tJavaRow_1 (note the default for context.read_data should be 
&lt;B&gt;false &lt;/B&gt;)&amp;nbsp; 
&lt;BR /&gt; 
&lt;PRE&gt;&lt;BR /&gt;if( input_row.line.matches("report data") ) {&lt;BR /&gt;	context.read_data = true;&lt;BR /&gt;}&lt;BR /&gt;if( input_row.line.matches("end report data") ) {&lt;BR /&gt;	context.read_data = false;&lt;BR /&gt;}&lt;BR /&gt;output_row.line = input_row.line;&lt;/PRE&gt; 
&lt;BR /&gt;Tmap: 
&lt;BR /&gt; 
&lt;BR /&gt; 
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009ME4d.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/129061i124B8293B090DCE8/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009ME4d.png" alt="0683p000009ME4d.png" /&gt;&lt;/span&gt; 
&lt;BR /&gt;Results: 
&lt;BR /&gt; 
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009ME98.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/131891iE87BB9A488BF4A6A/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009ME98.png" alt="0683p000009ME98.png" /&gt;&lt;/span&gt; 
&lt;BR /&gt;Test file:</description>
      <pubDate>Wed, 18 May 2016 22:25:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/extract-data-from-text-file/m-p/2329579#M98758</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-05-18T22:25:49Z</dc:date>
    </item>
    <item>
      <title>Re: extract data from text file</title>
      <link>https://community.qlik.com/t5/Talend-Studio/extract-data-from-text-file/m-p/2329580#M98759</link>
      <description>oops, looks like the screenshots got a little confused. 
&lt;BR /&gt;Results: 
&lt;BR /&gt; 
&lt;BR /&gt; 
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MDs6.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/154732i5FD589A5A5610AE4/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MDs6.png" alt="0683p000009MDs6.png" /&gt;&lt;/span&gt; 
&lt;BR /&gt;Test File: 
&lt;BR /&gt; 
&lt;BR /&gt; 
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MDlC.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/129953iB5A6C02E160954B3/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MDlC.png" alt="0683p000009MDlC.png" /&gt;&lt;/span&gt;</description>
      <pubDate>Wed, 18 May 2016 22:27:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/extract-data-from-text-file/m-p/2329580#M98759</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-05-18T22:27:05Z</dc:date>
    </item>
    <item>
      <title>Re: extract data from text file</title>
      <link>https://community.qlik.com/t5/Talend-Studio/extract-data-from-text-file/m-p/2329581#M98760</link>
      <description>John - this is perfect! thank you!</description>
      <pubDate>Fri, 20 May 2016 20:15:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/extract-data-from-text-file/m-p/2329581#M98760</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-05-20T20:15:25Z</dc:date>
    </item>
  </channel>
</rss>

