Author |
Message
|
Laurens |
Posted: Fri Sep 27, 2013 3:46 am Post subject: FileInput node multiple wildcards |
|
|
Apprentice
Joined: 01 Oct 2009 Posts: 35
|
dear Experts,
I'm trying to configure my FileInput node to read multiple patters.
Say *.txt and *.xml.
Can one configure more then one pattern on the file node ?
Otherwise I have to go through the hassle of multiple FileInputnodes.
FileRead node not possible because I'm reading from an ftp server.
Kind regards
Laurens |
|
Back to top |
|
 |
lancelotlinc |
Posted: Fri Sep 27, 2013 3:54 am Post subject: Re: FileInput node multiple wildcards |
|
|
 Jedi Knight
Joined: 22 Mar 2010 Posts: 4941 Location: Bloomington, IL USA
|
Laurens wrote: |
Otherwise I have to go through the hassle of multiple FileInputnodes. |
Why is using more than one node a hassle? Can you not just drag the second node onto the canvas and connect the wires ? Why is it a big deal ? _________________ http://leanpub.com/IIB_Tips_and_Tricks
Save $20: Coupon Code: MQSERIES_READER |
|
Back to top |
|
 |
dogorsy |
Posted: Fri Sep 27, 2013 4:01 am Post subject: |
|
|
Knight
Joined: 13 Mar 2013 Posts: 553 Location: Home Office
|
Quote: |
Say *.txt and *.xml.
Can one configure more then one pattern on the file node ?
|
What does the documentation for the fileInput node say ? |
|
Back to top |
|
 |
Laurens |
Posted: Mon Sep 30, 2013 11:34 pm Post subject: |
|
|
Apprentice
Joined: 01 Oct 2009 Posts: 35
|
Well to answer the first question , the point is that for each additional filetype to be read one would only need to update a promoted property in the bar file.
While if I need to add a FileInput node on the canvas there is new coding + testing. The wildcard is not so much *.txt but rather FileName1*.txt FileName2*.txt
To answer number two , I was wondering just like the 'ls' or 'dir' there is a way to make the wildcard string so that you can have multiple constraints.
The documentation only states that a wildcard is possible , but it doesn't define in detail the possibilities of the wildcard. |
|
Back to top |
|
 |
dogorsy |
Posted: Mon Sep 30, 2013 11:56 pm Post subject: |
|
|
Knight
Joined: 13 Mar 2013 Posts: 553 Location: Home Office
|
Laurens wrote: |
To answer number two , I was wondering just like the 'ls' or 'dir' there is a way to make the wildcard string so that you can have multiple constraints.
The documentation only states that a wildcard is possible , but it doesn't define in detail the possibilities of the wildcard. |
Yes it does.
Quote: |
In File name or pattern, specify a pattern for the file name. It is either a file name or a character sequence (a pattern) that matches a file name. A pattern is a sequence containing at least one of the following wildcard characters:
Wildcard character Description Example
* Any sequence of zero or more characters *.xml matches all file names with an xml extension
? Any single character f??????.csv matches all file names consisting of the letter f followed by six characters and then the sequence .csv.
For a file to be processed, its name must match the pattern.
If you specify a file name pattern that contains wildcard characters, the FileInput node copies the characters in the file name matched by wildcards, together with any intermediate characters, to the LocalEnvironment.Wildcard.WildcardMatch element. See File name patterns for more information. |
|
|
Back to top |
|
 |
Tibor |
Posted: Tue Oct 01, 2013 4:27 am Post subject: |
|
|
 Grand Master
Joined: 20 May 2001 Posts: 1033 Location: Hungary
|
Perhaps, you can catch all the files (pattern='*'), then throw away the superfluous ones based on your own logic...  |
|
Back to top |
|
 |
lancelotlinc |
Posted: Tue Oct 01, 2013 4:32 am Post subject: |
|
|
 Jedi Knight
Joined: 22 Mar 2010 Posts: 4941 Location: Bloomington, IL USA
|
Laurens wrote: |
Well to answer the first question , the point is that for each additional filetype to be read one would only need to update a promoted property in the bar file.
While if I need to add a FileInput node on the canvas there is new coding + testing. The wildcard is not so much *.txt but rather FileName1*.txt FileName2*.txt |
It seems your design is fragile and apt to break. A properly designed flow would handle this gracefully without breakage. _________________ http://leanpub.com/IIB_Tips_and_Tricks
Save $20: Coupon Code: MQSERIES_READER |
|
Back to top |
|
 |
dogorsy |
Posted: Tue Oct 01, 2013 5:48 am Post subject: |
|
|
Knight
Joined: 13 Mar 2013 Posts: 553 Location: Home Office
|
Tibor wrote: |
Perhaps, you can catch all the files (pattern='*'), then throw away the superfluous ones based on your own logic...  |
Really ?...  |
|
Back to top |
|
 |
Tibor |
Posted: Tue Oct 01, 2013 5:51 am Post subject: |
|
|
 Grand Master
Joined: 20 May 2001 Posts: 1033 Location: Hungary
|
@dogorsy: why not? I don't know how the file processing works there, so it would be a solution. (Besides, a smiley was inserted ) |
|
Back to top |
|
 |
dogorsy |
Posted: Tue Oct 01, 2013 5:55 am Post subject: |
|
|
Knight
Joined: 13 Mar 2013 Posts: 553 Location: Home Office
|
why not ?... maybe you should go and read how the fileinput node works. Files are in a directory for a good reason, you don't want them to be removed from it only because you cannot work out another way to deal with them.
Quote: |
I don't know how the file processing works there |
in that case, maybe you should not comment...  |
|
Back to top |
|
 |
|