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

View solution in original post

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

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

View solution in original post

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