Four Stars

1 input --> 2 OutputExcel that generate a single .xls file

Hi,

 

I have a .csv file input. I use a filter to split my input in 2 tMap.

Both have the same schema (in the first tMap, i do some calculations that are different in the 2nd).

The thing is that I want only one .xls file in output.

So, after both tMap, i have a tFileOutputExcel with the same FileName in output. For one, i select "Add to existing file' and 'add to existing sheet' options but these lines are not in my generated file.

 

Why my lines from A_KO are not in my output (it's that one that have the "add to existing file/sheet" options) ?

 

attached file : a screenshot of my job

 

1 ACCEPTED SOLUTION

Accepted Solutions
Ten Stars

Re: 1 input --> 2 OutputExcel that generate a single .xls file

If it continues to be a problem, since both flows have the same schema, you can throw both of them into a shared Hash, then write out the data all at once to your Excel file.
5 REPLIES
Twelve Stars TRF
Twelve Stars

Re: 1 input --> 2 OutputExcel that generate a single .xls file

I think the reason is that A_KO is the 1st flow after tFilter, so you need to select "Add to existing file" for A file else the content from A_KO will be truncated. You may also change the flow order.

Let us know.


TRF
Four Stars

Re: 1 input --> 2 OutputExcel that generate a single .xls file

In my output, the first flow is A_OK (rejected_order). In fact, I have 20 A_OK lines and only one A_KO.

I tried to switch the flow order by selecting "Add to existing file" for A file but I obtained a error message saying that the output file doesn't exist (which is logical).

 

For now, i keep "Add to existing file" for A_KO file but in the near future, if one of my first line is KO, my job will break...

I need to manage that too...

Ten Stars

Re: 1 input --> 2 OutputExcel that generate a single .xls file

If it continues to be a problem, since both flows have the same schema, you can throw both of them into a shared Hash, then write out the data all at once to your Excel file.
Twelve Stars TRF
Twelve Stars

Re: 1 input --> 2 OutputExcel that generate a single .xls file

You can have the "Add to existing file" option for both output files.

It's just an indicator to avoid the file content to be lost if the file exists, but it is not a problem to write to a new file with this option, even if the file doesn't exists yet.


TRF
Four Stars

Re: 1 input --> 2 OutputExcel that generate a single .xls file

Thanks for the replies.

 

@TRF : When i use "Add to existing file" option, I have this error if the file has not been created yet : 

jxl.read.biff.BiffException: The input file was not found
	at jxl.read.biff.File.<init>(File.java:124)
	at jxl.Workbook.getWorkbook(Workbook.java:221)

@cterenzi : I'll try that. I never used tHash components before (I'm new to Talend). 

 

I keep you posted.

 

Edit : tHash components works perfectly fine. I got all my datas and no more issues about wich output is gonna create the file.

 

Thanks a lot for your help Smiley Happy