Grouping rows

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)

 

Fifteen Stars TRF
Fifteen 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
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 GARNER 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

What’s New for Talend Summer ’19

Watch the recorded webinar!

Watch Now

Best Practices for Using Context Variables with Talend – Part 4

Pick up some tips and tricks with Context Variables

Blog

How Media Organizations Achieved Success with Data Integration

Learn how media organizations have achieved success with Data Integration

Read

APIs for Dummies

View this on-demand webinar about APIs....

Watch Now