Six Stars

Output rejection based on specific condition

Hello,

 

My idea is to :

1. count the delimiters per line

 

tjavarow

output_row.line = input_row.line;
context.DelCount = StringHandling.COUNT(input_row.line, ";");

 

2. gather rows not equal the default delimiters value

 

tmap => Expression filter

context.DelCount < 10

 

3. Finally i used a tjavaflex to check if i have any rejection.

 

if(nb==0){
globalMap.put("hasData",false);
}else {
globalMap.put("hasData",true);

 

 

sdf.JPG

 

What i am not able to do:

 

If there is any rejection ("hasData",true), i want to output all the rows in a file then finally die.

 

tjavaflex cannot get the schema from the tmap i guess.

 

Any idea how to handle this?

 

Best regards,

asadasing

1 REPLY
Six Stars

Re: Output rejection based on specific condition

rhall_2_0
If another word i want to output the file only if it contain a row