Talend Connect
Virtual Summit
JOIN US!
And visit the Customer
& Community Lounge.
May 27-28, wherever you are.

Iterate to use tReplace component in sheets of an excel file

Highlighted
One Star

Iterate to use tReplace component in sheets of an excel file

Hi,

I have an excel file composed of 4 sheets. I'd like to replace some values by other values in both sheets. Then, the output file would be the same excel file, composed of its 4 sheets with all the values, including those replaced.

I used tFileExcelWorkbook and tFileExcelSheetList to parse my Excel file, then tFlowIterate to create a global variable (name of sheet) and tReplace to make the search/replace.

But after I'm stuck.. How to make it to create the same excel file, with the same sheets by using tReplace component ?

Here is a screenshot of what I tried..



Would you have any solutions ?
Thank you very much for the help !

Julien

Highlighted
Four Stars

Re: Iterate to use tReplace component in sheets of an excel file

Could you use your currently written process to write a new file (with the replaced values), then rename the source file to something like $FILENAME.$TIMESTAMP.xlsl and rename the new file to the original file's name?
I'm not familiar with the tFileExcelSheet components (so I don't know exactly how you'd use the output one), but I'm pretty sure you could use the regular excel output component (tFileOutputExcel).  You would want to set that component to append and put your sheet-name variable from tFlowToIterate in the sheet name field.   With your existing job, you could just replace tLogRow with that component and then add the name change logic afterward.

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