how to validate filename which is going to be used as inputfile

One Star

how to validate filename which is going to be used as inputfile

Hello,
I am new kid on this Talend tool forum and it gives me lot of excitement to work with this tool.
I need a small help from u guyz, who have already mastered this tool. I want to validate filename
before taking it as my input and exporting the data from that file in to the database.
here goes my example
'filename_eventid_timestamp.dat' like 'customerdata_1001_03132009.dat'
if any of the input file is not in this format needs to be pointed out.here i mentioned only the .dat files but my requirement is to validate for all extensions whether it is .xml,.cvs whatever it maybe. if possible provide me some code snippet with example.
u r help will be greatly appreciated.
Thanks in advance,
chandra.
Community Manager

Re: how to validate filename which is going to be used as inputfile

Hello Chandra
You can use tFileList component to iterate all files based on the filemask, like *.dat
Please read the user documentation and lits usage.
Best regards

shong
----------------------------------------------------------
Talend | Data Agility for Modern Business
One Star

Re: how to validate filename which is going to be used as inputfile

Hi chandra,
if you need a more complex check you could use tIterateToFlow and set the filename as an attribute in your row. Now you could use standard components to handle the files. Before you use an input component add a tFlowToIterate to get back to the iteration.
Bye
Volker
One Star

Re: how to validate filename which is going to be used as inputfile

Thankq guyz for such a immediate response. I will go through the document and i will post later if i still need anything more information.
Talend rocks!!!!!
chandra.