Page 1 of 1

Creating a file 'Dynamically'

Posted: Mon Apr 04, 2005 5:14 pm
by yaminids
Hello friends,

Is there any way to create a file dynamically. I have about 60 records (containing names of customers) in the input file and my intension is to create a separate file for each customer.

Thanks very much in advance
-Yamini

Posted: Mon Apr 04, 2005 11:22 pm
by dhiraj
You could but all the files you create would be enclosed in a folder.

Use the folder stage as your target. Folder stage takes 2 columns as inputs. first is the file name and the second should be the entire record concatenated (or data that you wish to write to the file).

Regards
Dhiraj

Posted: Tue Apr 05, 2005 6:32 am
by Sainath.Srinivasan
Try a unix level command as given below

for i in `sort -u testfile.txt`
do
grep "$i" testfile.txt > $i.out
done

where testfile.txt is the name of your file. You may have to change the sort and grep commands to indicate the position, case sensitivity etc.