I am creating multiple files through one sequential file stage using the "Generate Multiple Files" option.
The filename is based on a root file string plus the value of a key column, so that for each distinct value of the key column a new file is generated containing the key value in the file name.
For the output properties I have set:
- Write Method = Generate Multiple Files
- Exclude Partition String = True
- Key = <fieldname>
- Use Value in Filename=True
- Root File String = <base file name>
That works perfectly fine. However it forces me to include the key column in the output, and I do not want to include that in the output. I only want to use it to set the filenames of the output file.
Is there any way I can achieve that? (using the generate multiple files property)
Generate Multiple Files without outputting key column value
Moderators: chulett, rschirm, roy
Reply
make the unwanted key column the first field in the column definition. Then Use the Filter Property of sequential file.
put unix script : cut -d, -f2,n
n--> total number of columns
This will print all the columns except the first.
put unix script : cut -d, -f2,n
n--> total number of columns
This will print all the columns except the first.
Last edited by ssnegi on Thu Mar 20, 2014 3:40 am, edited 2 times in total.
resolved
I was able to generate multiple files using the "generate multiple files" option.
You need to define the Key field (Ex: Region) on which you would like to split the data. I also included the Root File string to point to the Directory where the files will be created. You specify the file name in the root file string
Ex: /....../InformatServer/Projects/Project1/TgtFiles/Region
and it created multiple files with prefix Region.part00004.001,Region.part00009.001,.....
I still am playing with the providing the filename in a format that I need.
An option would be to use shell script for changing filenames after job has finished.
But the data in each file is specific to the Region field in my source data and it seems to be working.
You need to define the Key field (Ex: Region) on which you would like to split the data. I also included the Root File string to point to the Directory where the files will be created. You specify the file name in the root file string
Ex: /....../InformatServer/Projects/Project1/TgtFiles/Region
and it created multiple files with prefix Region.part00004.001,Region.part00009.001,.....
I still am playing with the providing the filename in a format that I need.
An option would be to use shell script for changing filenames after job has finished.
But the data in each file is specific to the Region field in my source data and it seems to be working.