How to avoid Special sheets not exist / tFileInputExcel

One Star

How to avoid Special sheets not exist / tFileInputExcel

Hi,
I'm having a little trouble with the tFileInputExcel component. I have a number of excel files which have 2-6 sheets and I want to edit them (change a few values via tmap) and extract them into single csv files. This means one subjob only reads one sheet of a number of excel files. My problem is, the sheets which I entered into the sheet list may not exist in every excel file and if they don't the whole subjob dies with the error "Special sheets not exist!".
Is there a way to avoid this problem e.g. an ignore error switch?
tFileList -> tFileInputExcel -> tMap -> tFileOutputDelimited
I'm using Talend with Java.
Thanks for your help,
Hamburg
Highlighted
One Star

Re: How to avoid Special sheets not exist / tFileInputExcel

I would use a tJava after the tFileList and use jExcel (which Talend use internally) to check if the sheetName exist for the current file.
http://jexcelapi.sourceforge.net/resources/javadocs/2_6_10/docs/jxl/Workbook.html
One Star

Re: How to avoid Special sheets not exist / tFileInputExcel

Hi,
thanks for your idea but I'm not quite sure I understand how exactly that would work.
tFileList -> tJava -> tFileInputExcel ... ?
Could you perhaps give a short example?
-
Never mind, I found an 'old' topic where an equal example is given.
Thank you very much!

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

What’s New for Talend Summer ’19

Watch the recorded webinar!

Watch Now

Best Practices for Using Context Variables with Talend – Part 2

Part 2 of a series on Context Variables

Blog

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