I don't believe it can be done using dynamically generated file names without creating some code. I would be happy to be corrected.
What's the basis of the Filter stage? You can't have a dynamic number of output links! What's your strategy for separating the countries? About the only strategy with a Filter stage would be to have an output link for every possible country. Some output links will receive zero rows. These can be detected subsequently.
Filter stage and dynamic file creation
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
-
- Participant
- Posts: 407
- Joined: Mon Jun 27, 2005 8:54 am
- Location: Walker, Michigan
- Contact:
Could you use an external target stage for your job? You could create a shell script similar to the one below. It will create a file for each distinct value of $1 (the first field), named $1.file.
Code: Select all
#!/bin/ksh
AFS="${1}"
DIR="${2}"
awk -vAFS="${AFS}" -vDIR="${DIR}" 'BEGIN {FS=AFS;OFS=AFS;}
{
## CTRY FILE NAME
FNAME=$1".file";
print $0 >DIR""FNAME;
}'
exit 0
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
-
- Participant
- Posts: 407
- Joined: Mon Jun 27, 2005 8:54 am
- Location: Walker, Michigan
- Contact:
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact: