tFileList exclude mask

One Star

tFileList exclude mask

Hi, Is it possible to use more than one tFileList exclude mak and how could I do that if possible?
One Star

Re: tFileList exclude mask

Since the exclude fileMask is a regular expression, you can write your exclude filemask like this :
"(*.txt)|(*.pdf)|(*.doc)"

it should exclude txt, pdf and doc files (for example).
Note : I wrote a java regular expression, but the filemask is waiting for a Glob regular expression. Since I don't know theses expressions, I can't certify the syntax.
One Star

Re: tFileList exclude mask

Works perfectly, thanks a lot!
Edit: that was a little too fast, in fact it doesn't work! Thanks anywa for your help, but the topic is still opened
One Star

Re: tFileList exclude mask

I checked it : the idea was correct but not the syntax Smiley Wink
Here is the good method with a java job :
1) uncheck the "use glob regular expression checkbox" (basic settings)
2) in "filemask", put a single line ".*" (the default "*" filemask does not compile when "glob expression" are desactivated). Of course, this pattern can be replaced by another (and by more than one line), but with a JAVA regular expressions (".+\\.wav" to allow the wav files, for example).
3) in "exclude filemask", this is the good syntax to exclude txt, doc and pdf files :
"(.+\\.txt)|(.+\\.pdf)|(.+\\.doc)"

I tested it in a real Talend job and it works.
If I have some time, I will modify the tFileList component to allow a list of glob exclude patterns (they are easier to write).
One Star

Re: tFileList exclude mask

Ok, thanks a lot and by the way, a list of glob exclude masks would be great!
Diane
One Star

Re: tFileList exclude mask

Ok, thanks a lot and by the way, a list of glob exclude masks would be great!
Diane

It's done !
You can try this component : http://www.talendforge.org/exchange/tos/extension_view.php?eid=164
Highlighted
One Star

Re: tFileList exclude mask

Great I didn't check my posts for a while, thanks a lot
One Star

Re: tFileList exclude mask

I looked into the generated source code:
for (String excludefilemaskEach_tFileList_1 : excludefilemask_tFileList_1.split(",")) {}

It gives a hint for the correct glob exclude syntax:
"*.txt,*.pdf,*.doc"

Of course, I tested it and it works. ;-)
One Star

Re: tFileList exclude mask

Hi,
Thank, the good way to exclude file is with comma : "(myexcludedfile.*),(myotherexcludedfile.*)"
One Star

Re: tFileList exclude mask

You dont need the brackets "(" around it. This works:
"000*,001*"