Grouping rows

Highlighted
Four Stars

Grouping rows

I have data in a .txt file formatted like this: 

        Sample Name      Analyte       Equation       Result
        --------------------------------------------------------------------
        Sample 1         Result        Equation 1     3.6059E-3
                                       Equation 2     2.0701E-4
                                       Equation 3     3.6059E-3
                                       Equation 4     2.0747E-4
        Sample 2         Result        Equation 1     3.5815E-3
                                       Equation 2     1.9839E-4
                                       Equation 3     3.5815E-3
                                       Equation 4     1.9954E-4
        Sample 3         Result        Equation 1     3.5945E-3
                                       Equation 2     2.0606E-4
                                       Equation 3     3.5945E-3
                                       Equation 4     2.0688E-4

I want to group the data of each sample (every 4 rows), but I don't know how when each row does not contain the sample name. How can I do this?

 

(PS I am using version 4.1.1 & I am new to Talend)

 

Highlighted
Sixteen Stars
Sixteen Stars

Re: Grouping rows

Use tMap variables to store sequence value to be reinitialized when the value of 4 is reached. Other tMap variables to store current record values only when the sequence is equal to 1.

TRF
Highlighted
Four Stars

Re: Grouping rows

Do you mind elaborating on this a bit? What would this tMap variable look like? My apologies, like I said, I am very new to this.

2019 GARTNER MAGIC QUADRANT FOR DATA INTEGRATION TOOL

Talend named a Leader.

Get your copy

OPEN STUDIO FOR DATA INTEGRATION

Kickstart your first data integration and ETL projects.

Download now

Best Practices for Using Context Variables with Talend – Part 1

Learn how to do cool things with Context Variables

Blog

Migrate Data from one Database to another with one Job using the Dynamic Schema

Find out how to migrate from one database to another using the Dynamic schema

Blog

Best Practices for Using Context Variables with Talend – Part 4

Pick up some tips and tricks with Context Variables

Blog