Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello, I'd like to know if it's possible to manage different file format from a tFileList ?
My situation : a directory with xls, xlsx and csv files (all have the same format).
I want to iterate with tFileList with *.xls, *.xlsx and *.csv patterns and then redirect to a tFileInputDelimited or tFileInputExcel depending on file extension.
Thanks for your help !
It shouldn't... Unless your filters in the tFileList is not working. Do you have more than 1 file?
Assuming your tFileList is called tFileList1, check the value of "((String)globalMap.get("tFileList_1_CURRENT_FILEEXTENSION"))" to decide which component must be used to read the content of the current file.
Hi TRF,
From tFileList component I'have to draw an iterate link ... to what kind of component ?
If I draw a "Execute if" link from the tFileList to a tFileInputDelimited and another to tFileInputExcel, there is no more iteration ...
I've never try this before.
What if you put a dummy tJava after tFileList? Does this also break the iteration?
You can link the Iterate to a tJava as a stub, and then draw Run If links from the tJava. The tJava basically becomes a Stub to draw links from. But you definitely needs to use iterate from the tFileList
Here's what I have done :
tFileList (with my 3 patterns)
-->iterate
-->tJava
-->runIf order#1 ((String)globalMap.get("tFileList_5_CURRENT_FILEEXTENSION")).equals("csv")-->tFileInputDelimited
-->runIf order#2 ((String)globalMap.get("tFileList_5_CURRENT_FILEEXTENSION")).equals("xls")-->tFileInputExcel
-->runIf order#3 ((String)globalMap.get("tFileList_5_CURRENT_FILEEXTENSION")).equals("xlsx")-->tFileInputExcel
When I run the job, it takes my first file (a csv), call the right branch (open with tFileInputDelimited) and stop !
Seems that iteration stops !
It shouldn't... Unless your filters in the tFileList is not working. Do you have more than 1 file?
Your right, I made a mistake ... sorry !
Thank you for your help !