Page 1 of 1

split records to multiple output files

Posted: Tue Jan 16, 2007 5:21 am
by PeterPol
hi all,

I have a requirement to split a DBF file based on the values in one column, into a number of output files.
One output file for each split value.
So, if the input column has the following values: A, B, C, D the job should create 4 files named A.DBF, B.DBF, C.DBF, D.DBF each filled with the correctly splitted records.

Can I use the switch stage for this?
How to handle the fact that I don't know the number of output files in advance.

Peter

Posted: Tue Jan 16, 2007 5:36 am
by kumar_s
One approach would be, count the number of records (can be using link row count) and pass it as a variable into Loop activity, for each loop read the corresponding line of the file and pass the value as parameter to a job to create a file using that job parameter value.

In server jobs we can use a folder stage

Posted: Tue Jan 16, 2007 11:02 pm
by rajiivnb
Hi,

In Server Job I used a folder stage to do this logic. In a folder stage give your input column as the filename and the other columns concatenated give it to Record field of the Folder stage. This will create multiple files.