Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Learn how to migrate to Qlik Cloud Analytics™: On-Demand Briefing!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

How to process both xls (2003) and xlsx (higher 2007) with same input

Hi,
is there any way that i can process both the excel (xls and xlsx) using tFileInputExcel
Note : i checked the option (Read excel2007 file format) it just process only xlsx file not xls files
the code that generated by talend when i check this option it uses org.apache.poi.xssf.usermodel.XSSFWorkbook to read the file
if not checked then it uses java.io.BufferedInputStream to read file.
I appreciate if any once can send a solution that process both (xls and xlsx) at same time.
Thanks
Labels (3)
2 Replies
Anonymous
Not applicable
Author

Hello
Using tFileList to list each file and get the file properties, if the file extension is xls, read the file using tFileInputExcel with unchecking the option, if the file extension is xlsx, read the file using another tFileInputExcel with checking the option. eg:
tFileList---iterate---tJava---runIf---tFileInputExcel_1...
---runIf---tFileInputExcel_2...
tJava: get the file name, parse the file extension, set the extension to global variable, eg: globalMap.put("extension","xls")
runIf: set the condition like: (String)globalMap.get("extension").equals("xls")
Best regards
Shong
Anonymous
Not applicable
Author

Thanks shong...........I appreciate your time.