Insert data to the multiple Excel files

Good morning, I’m trying to solve following issue and I can’t find way how to do it elegantly. I have set of Excel files with same structure, each of them contains different data. I have set of data in MySQL database where I calculated some values. Finally I need to get data from database and write appropriate data to the right Excel (I have the flag to which file data have to be written). Is there any way how to handle information, transferred by metadata to the file URL in the spreadsheet writer? I found the possibility how to use Parameter but I need to dynamically set this parameter file by file. Thanks for the answer.

Hi vachah,

I would use http://doc.cloveretl.com/documentation/ … files.html

In short:
* add field into metadata describing output file name
* set partitioning on SpreadsheetDataWriter with this new field as key
* and do something like described on line “path/outjohnsmith.xls, path/outmarksmith.xls, path/outmichaelgordon.xls, etc. (if File URL is path/out#.xls and Partition file tag is set to Key file tag).” of doc above.

I hope this helps.

Good afternoon, I know this functionality but it is not what I look for. I have many .flax files with different names and different data but with the same structure and I need to fill data from database to appropriate .flax file. To do this I need to indentify appropriate .xlsx file (when data comes from database and pair each row with appropriate data from database). I have enough information in database to identify appropriate .xlsx file but I don’t know how to handle these data to open file/s I won’t to open.
Thanks, Hynek

Hello, vachah,

we are still not sure what you want to do. Our best guess is following:

The first part of your input data is stored in MySQL database and each record has a pointer to the second part of your input data. You want to join these two data sets and to do that you have to open appropriate file with the second half of your input data.

You can send some path to a file as string to some reader component and set the reader to process input stream as a path to the file you want to read. In the File URL field of the reader will be something like port:$0.Field1:source (Autofilled by clicking on Port tab in URL Dialog and selecting appropriate options.) where Field1 is a name of the field in metadata. More info here http://doc.cloveretl.com/documentation/ … ading.html

I have also prepaired an example for you, simplified - just for your inspiration.

inputfiles.zip

I hope this is what you were looking for. If we got you wrong again, I am sorry, please try to send some example input and output files with example data in this case. Thank you.

Best regards,

Thanks a lot. The second works fine for our purpose.