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

Highlighted
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
Highlighted
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

View solution in original post

Highlighted
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".

View solution in original post


All Replies
Highlighted
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

View solution in original post

Highlighted
Six Stars

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

 
Highlighted
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

 
Highlighted
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".

View solution in original post

Highlighted
Six Stars

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

Thank you so much.. !!!

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 2

Part 2 of a series on Context Variables

Blog

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