March 26, 2008 at 7:07 am
Hi,
I have a flat file (csv) which has the datestamp of the data in cell r1c1. on row 2 I have the data headers, and rows 3 onwards has the data itself. I need to extract the data to a SQL table on a daily basis, and need the datestamp (r1c1) to use as part of the primary key. I have tried many ways, but I am unsure as to how to get the r1c1 data into a variable, then process the rest of the flatfile (rows 2 onwards).
Using the flatfile connector either gets rid of the datestamp row, or adds it to row 2 - which mean the column headers no longer line up with the data. I assume a script task would be a way to go?.....but i don't know where to start with that option.
does anyone show me how this can be achieved?.
all help gratefully received.
March 26, 2008 at 10:20 am
I think a combination of script task and also setting the file (at least for an initial pass) to be ragged right.
One way to do this might be:
use a container, in that container, set the Flatfile to ragged right; Have it read only the first row (can't remember if you can limit this on the connector or perhaps the transform, if neither, then you'd have to do it in your script component); assuming we can limit it to the first row (regardless of method) in a scrript class, set a package level variable to the date value.
outside of this container, you could have a second container whose precedence is the successful exeuction of the first one (above). in the second container, process the file as normal (possibly skipping the first row to ignore the date).
Steve.
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply