<?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: [resolved] How to get the last 10 lines from file using tsamplerow? in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/resolved-How-to-get-the-last-10-lines-from-file-using-tsamplerow/m-p/2278069#M53648</link>
    <description>Add a sequence id to each row on tMap, and then sort the rows with desc model on tSortRow, define a var to generate the sequence id on another tMap, filter the first 10 lines using the sequence id.</description>
    <pubDate>Fri, 06 Feb 2015 03:58:34 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2015-02-06T03:58:34Z</dc:date>
    <item>
      <title>[resolved] How to get the last 10 lines from file using tsamplerow?</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-How-to-get-the-last-10-lines-from-file-using-tsamplerow/m-p/2278068#M53647</link>
      <description>Hi Master,&lt;BR /&gt;I use tfileinputDelimited to read a file and then need to get the last 10 lines from this file. &lt;BR /&gt;i try to use tSamplerow but it can not read NB_LINE from tFileInputDelimited when using Main Connection. &lt;BR /&gt;i try to save it first to context but still return null when using Main connection.&lt;BR /&gt;Do you have any idea?&lt;BR /&gt;Thank you and best regards.</description>
      <pubDate>Fri, 06 Feb 2015 03:36:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-How-to-get-the-last-10-lines-from-file-using-tsamplerow/m-p/2278068#M53647</guid>
      <dc:creator>orawajar</dc:creator>
      <dc:date>2015-02-06T03:36:25Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] How to get the last 10 lines from file using tsamplerow?</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-How-to-get-the-last-10-lines-from-file-using-tsamplerow/m-p/2278069#M53648</link>
      <description>Add a sequence id to each row on tMap, and then sort the rows with desc model on tSortRow, define a var to generate the sequence id on another tMap, filter the first 10 lines using the sequence id.</description>
      <pubDate>Fri, 06 Feb 2015 03:58:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-How-to-get-the-last-10-lines-from-file-using-tsamplerow/m-p/2278069#M53648</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-02-06T03:58:34Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] How to get the last 10 lines from file using tsamplerow?</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-How-to-get-the-last-10-lines-from-file-using-tsamplerow/m-p/2278070#M53649</link>
      <description>Hi shong thank you for your fast response,
&lt;BR /&gt;Nice idea but a little bit inefficient i think because sorting large data will take much time.
&lt;BR /&gt;It will be great if i can use NB_LINE that already provided by tFileInputDelimited.&amp;nbsp; Do you have any idea that i can do, maybe doing something with tSampleRow, so it can read the NB_LINE?
&lt;BR /&gt;Thank you and best regards,</description>
      <pubDate>Fri, 06 Feb 2015 04:18:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-How-to-get-the-last-10-lines-from-file-using-tsamplerow/m-p/2278070#M53649</guid>
      <dc:creator>orawajar</dc:creator>
      <dc:date>2015-02-06T04:18:51Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] How to get the last 10 lines from file using tsamplerow?</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-How-to-get-the-last-10-lines-from-file-using-tsamplerow/m-p/2278071#M53650</link>
      <description>Hi&amp;nbsp; 
&lt;BR /&gt;The global var NB_LINE can be only used on another subjob, you need to read the source file two times (or one time if you want to store the data into memory). For example: 
&lt;BR /&gt;tFileInputDelimited_1--main--tJava_1 
&lt;BR /&gt;&amp;nbsp; &amp;nbsp;| 
&lt;BR /&gt;onsubjobok 
&lt;BR /&gt;&amp;nbsp; &amp;nbsp;| 
&lt;BR /&gt;tJava_2 
&lt;BR /&gt;&amp;nbsp; &amp;nbsp;| 
&lt;BR /&gt;onsubjobok 
&lt;BR /&gt;&amp;nbsp; &amp;nbsp;| 
&lt;BR /&gt;tFileInputDelimited_2--main--tSampleRow--main--tLogRow 
&lt;BR /&gt;or&amp;nbsp; 
&lt;BR /&gt;tFileInputDelimite--main--tHashOutput 
&lt;BR /&gt;&amp;nbsp; &amp;nbsp;| 
&lt;BR /&gt;onsubjobok 
&lt;BR /&gt;&amp;nbsp; &amp;nbsp;| 
&lt;BR /&gt;tJava_2 
&lt;BR /&gt;&amp;nbsp; &amp;nbsp;| 
&lt;BR /&gt;onsubjobok 
&lt;BR /&gt;&amp;nbsp; &amp;nbsp;| 
&lt;BR /&gt;tHashInput--main--tSampleRow--main--tLogRow 
&lt;BR /&gt;on tJava_2: get the NB_line, define the range expression for used later on tSampleRow 
&lt;BR /&gt; 
&lt;PRE&gt;int nb_line=((Integer)globalMap.get("tFileInputDelimited_1_NB_LINE"));&lt;BR /&gt;int begin=nb_line-9;&lt;BR /&gt;context.range=begin+".."+nb_line;&lt;/PRE&gt; 
&lt;BR /&gt;//Define a context var called range in the job. 
&lt;BR /&gt;on tSampleRow, set the range expression with context var. 
&lt;BR /&gt; 
&lt;PRE&gt;context.range&lt;/PRE&gt;</description>
      <pubDate>Fri, 06 Feb 2015 04:42:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-How-to-get-the-last-10-lines-from-file-using-tsamplerow/m-p/2278071#M53650</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-02-06T04:42:47Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] How to get the last 10 lines from file using tsamplerow?</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-How-to-get-the-last-10-lines-from-file-using-tsamplerow/m-p/2278072#M53651</link>
      <description>Okay shong. i prefer your second solution.. 
&lt;BR /&gt;it work for me. 
&lt;BR /&gt;Thank you shong.</description>
      <pubDate>Fri, 06 Feb 2015 06:51:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-How-to-get-the-last-10-lines-from-file-using-tsamplerow/m-p/2278072#M53651</guid>
      <dc:creator>orawajar</dc:creator>
      <dc:date>2015-02-06T06:51:22Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] How to get the last 10 lines from file using tsamplerow?</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-How-to-get-the-last-10-lines-from-file-using-tsamplerow/m-p/2278073#M53652</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;You can try this one.&lt;/P&gt; 
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Job Snapshot" style="width: 648px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M95H.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/129540iDAD45FF90436A6E7/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M95H.png" alt="0683p000009M95H.png" /&gt;&lt;/span&gt;&lt;SPAN class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Job Snapshot&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="tJava" style="width: 801px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M95M.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/139885iFE2FB3192618FF27/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M95M.png" alt="0683p000009M95M.png" /&gt;&lt;/span&gt;&lt;SPAN class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;tJava&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="tFileInputDelimied" style="width: 853px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M8ug.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/144394i5B059A7AF2016F95/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M8ug.png" alt="0683p000009M8ug.png" /&gt;&lt;/span&gt;&lt;SPAN class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;tFileInputDelimied&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Feb 2020 08:04:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-How-to-get-the-last-10-lines-from-file-using-tsamplerow/m-p/2278073#M53652</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-02-13T08:04:33Z</dc:date>
    </item>
  </channel>
</rss>

