September 4, 2007 at 4:06 pm
Hi,
Hopefully someone can assist with what appears to be a simple issue - and hopefully I am just looking in the wrong location.
I am wanting to pickup a file from a given folder, do some transformations on the data within the file, and then dump each row within the original file as a seperate txt file into a new folder.
I have managed to get it working - well all except having each row as a seperate txt file. Currently all the rows are outputed into the same txt file. argh
As it stands I have a For Each Loop Container, within this i have a Data Flow Container; which in itself, just has the source, some derived columns, and then an output.
How can I get this to pull each row from the source and put it as a seperate txt file. If someone can just nudge me in the right direction it would be much appreciated.
Thanks in advance
Troy
September 5, 2007 at 6:24 am
If you wanted to avoid writing any code, you could dump the data into a single temporary file (XML or a database table would be even better). Use another for each container to loop through the this file after pulling it into an ADO recordset in your control flow. Then, in your loop container, create a new text file for the output and put each row into the text file.
If you are ok writing some code, in your current data flow, add a script task as a destination container. In the script task, use the file system objects to create each text file and then directly write the record into the text file using VB.Net. This will take some code, but it will be more efficient in the long run.
I hope that all made sense to you - I have only had one coffee this morning.
September 5, 2007 at 3:06 pm
Thanks for the reponse Michael. Yeah it all makes sense, alas I am no good with code yet, so will have to look at the other solution you offered.
I would have thought that the Loop container would have had "rows" as a possible choice of an enumerator; as it has just about everything else... anyhow thanks for your response - am also looking into a possible way of using variables to get the info out too...which works okay in this instance, as the number of fields is only small - but certainly wouldn't want to go down that track if there were lots!! hehe
Thanks again
Troy
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply