SQLTeam.com | Weblogs | Forums

Import Files with Different Header Structures


#1

Hi
I currently have a directory of csv import files, all of which have the same data structure but different header information.

For example:
File 1
This is header info.
This is header info.
This is header info.
ID,Name, DOB, etc…

File 2
This is header info.
This is header info.
This is header info.
This is header info.
This is header info.
ID,Name, DOB, etc…

The data starts with the column title row, ie ID,Name, DOB.

What I need to happen is process that removes all the header rows up to the title row so that all import file structures will be the same.

I was thinking of using a ForEach Loop container that will run a script on each of the files to remove the header. Does anyone have a script which does is this or point me in the direction that will help.

Thanks in advance.


#2

you can use a conditional split transform in the data flow. add an expression that can detect the header rows and only send the non-header rows into the pipeline