Hi,
I was looking for an option to read the file for processing, from an input directory based on a particular naming convention.
For Ex: my filenames are expected in the format - ABC_YYYYMMDD.txt.
Just like data stage PX, Is there an option to pick the files starting with ABC_*.txt?
I tries using * wildcard to match the inputfile name. I dint get the expected result.
Please let me know whether I can achieve this in TX.
Thanks
Wildcard option for filenames in DS-TX
...
You should have no problems using wildcards; I haven't. I usually use something like;
*.txt
I haven't had the need to use ?. I have had wierd error messages on "shadow file rename failure" inregards to using wildcards, but after messing around with it, trying different things, I would always get it to work. It's been a while, but I think if you use wildcards in the input filename, you may have to use them in the output filename, but I could be wrong.
So if my input filename is;
*.txt
my output may have to be;
*.output.txt
for example. Try different things.
There's a lot of info in the documentation, such as;
General rules for using wildcards in adapter names: v
Directories cannot have wildcard notation in their names. v
A database source name cannot contain wildcard notation. v
If wildcards are used as sources or targets, at least one source trigger must have a wildcard. v
Question marks cannot be used in target file names. v
Multiple wildcards can be used in a source trigger name of a map, as long as there are no other source triggers. v
If more than one source file name contains a wildcard, that wildcard must be the same wildcard. v
Sources that are not event triggers and target names can contain at most one asterisk.
Wildcards v Can be used within a file name v
Cannot be used for directory names v
Can be used in Audit Log file names providing the input that is a trigger has the necessary wildcards to resolve the name for resource coordination
Multiple wildcards in a source name
If a source name has multiple wildcards and the target name has a single asterisk wildcard, the target name asterisk is replaced with the first wildcard value, next wildcard value, and any characters that exist between the wildcards. For example, with a source name of *a???b.c and a target name of *.d , if the source file name instance is: xyazzzb.c the target name assigned by the Launcher is: xyazzz.d
*.txt
I haven't had the need to use ?. I have had wierd error messages on "shadow file rename failure" inregards to using wildcards, but after messing around with it, trying different things, I would always get it to work. It's been a while, but I think if you use wildcards in the input filename, you may have to use them in the output filename, but I could be wrong.
So if my input filename is;
*.txt
my output may have to be;
*.output.txt
for example. Try different things.
There's a lot of info in the documentation, such as;
General rules for using wildcards in adapter names: v
Directories cannot have wildcard notation in their names. v
A database source name cannot contain wildcard notation. v
If wildcards are used as sources or targets, at least one source trigger must have a wildcard. v
Question marks cannot be used in target file names. v
Multiple wildcards can be used in a source trigger name of a map, as long as there are no other source triggers. v
If more than one source file name contains a wildcard, that wildcard must be the same wildcard. v
Sources that are not event triggers and target names can contain at most one asterisk.
Wildcards v Can be used within a file name v
Cannot be used for directory names v
Can be used in Audit Log file names providing the input that is a trigger has the necessary wildcards to resolve the name for resource coordination
Multiple wildcards in a source name
If a source name has multiple wildcards and the target name has a single asterisk wildcard, the target name asterisk is replaced with the first wildcard value, next wildcard value, and any characters that exist between the wildcards. For example, with a source name of *a???b.c and a target name of *.d , if the source file name instance is: xyazzzb.c the target name assigned by the Launcher is: xyazzz.d