how to skip every 5th row in a file using talend?

Highlighted
Five Stars

how to skip every 5th row in a file using talend?

i have a CSV file with 20 rows and i need output by skipping every 5th row and skipped rows i need to move to excel file.

Can you please help me on this?

input file,

------------

 

 

 

 

 

Fifteen Stars TRF
Fifteen Stars

Re: how to skip every 5th row in a file using talend?

Use a sequence in a tMap with 2 output flows and filter a specific filter for each.

Filters can be based on the result of a division by 5. If rest is 0 or not to decide which flow to go.


TRF
Five Stars

Re: how to skip every 5th row in a file using talend?

can you please explain with the expression in tmap

Community Manager

Re: how to skip every 5th row in a file using talend?

It should be something like this....

 

sequence_num%5==0

If the sequence number is divisible by 5 (% is a modulus operator), then the code above will return "true". In which case you can filter the row in your output table.

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

Talend API Designer – Technical Overview

Take a look at this technical overview video of Talend API Designer

Watch Now

Getting Started with APIs

Find out how to get started with APIs

Read