Run If Number of rows in the input file are greater than 1

Six Stars

Run If Number of rows in the input file are greater than 1

Hello,

 

I am trying to create a job, where I read a csv input file, and if the number of rows>1, it should run and pick the file and place into FTP location.

I have used tfileinputdelimited-->tjavarow-->tftpPut

I am stuck at tjavarow. How do I write a condition where it checks for number of rows >1. Please see the job img.JPG


Accepted Solutions
Nine Stars

Re: Run If Number of rows in the input file are greater than 1

You don't need tJavarow for this.

Connect tfileinputdelimited-->runif trigger-->tftpPut.

And put the condition for runIf as -

((Integer)globalMap.get("tFileInputDelimited_1_NB_LINE")) > 1
Nine Stars

Re: Run If Number of rows in the input file are greater than 1

I had suggested to use the "Run If" trigger and not "On Component Ok".

All Replies
Nine Stars

Re: Run If Number of rows in the input file are greater than 1

You don't need tJavarow for this.

Connect tfileinputdelimited-->runif trigger-->tftpPut.

And put the condition for runIf as -

((Integer)globalMap.get("tFileInputDelimited_1_NB_LINE")) > 1
Highlighted
Six Stars

Re: Run If Number of rows in the input file are greater than 1

 
Nine Stars

Re: Run If Number of rows in the input file are greater than 1

I am guessing you have the runif trigger already established between your two components - meaning you have both of them connected. Now, right click on the runIf connector - click settings - and you would be presented with Basic Settings -> Condition. Have your condition at that section.
Six Stars

Re: Run If Number of rows in the input file are greater than 1

 
Nine Stars

Re: Run If Number of rows in the input file are greater than 1

I had suggested to use the "Run If" trigger and not "On Component Ok".
Six Stars

Re: Run If Number of rows in the input file are greater than 1

Thank you so much.. !!!

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

Definitive Guide to Data Quality

Create systems and workflow to manage clean data ingestion and data transformation.

Download