Click here to monitor SSC
SQLServerCentral is supported by Redgate
Log in  ::  Register  ::  Not logged in
Home       Members    Calendar    Who's On

Add to briefcase

CSV Header Date as Column using SSIS 2012 Expand / Collapse
Posted Friday, March 21, 2014 4:39 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Wednesday, October 1, 2014 3:04 PM
Points: 4, Visits: 30
I'm new to both the forum and SQL Server. I'm using the Integration Services tool to manage the upload of multiple flat files into a data warehouse.

Most of the CSV files have several rows of data in the header detail before getting to the actual data. Not a problem, I just skip the first 8 rows and the data imports just fine.

My problem is that the date of the data is in the header information. I have to find the row with this value - Date range,"Mar 3, 2014 - Mar 3, 2014" - and extract that date (3/3/14) into a new column before inputting that into the destination.

If I just focus on the date, I was able to use a combination of a Flat file Source, Conditional Split (finding the row where LEFT([column],10) = "Date range"), and a Derived Column to pull that date out.

I know there is probably a better way using a script task, but I haven't gotten into C# and am not really sure where to start, or how to integrate that into the flow.

Any help that anyone can provide would be greatly appreciated.
Post #1553707
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse