Importing text file data using SSIS question.
-
Tuesday, February 28, 2012 7:50 PMIs there a way to import only the lines of data from a text file where you're able to avoid importing lines that include headers? Can headers and other elements get trapped and ignored during the import process? I'm currently using a Script component coded in C# for the imports. All works well, but I was wondering if I could avaoid coding the import and instead just use some SSIS functionality to drop the headers. The files for the most part contain fixed width columns of data. Thanks in advance.
Stan Benner
All Replies
-
Tuesday, February 28, 2012 7:56 PMModerator
Are there only headers lines on top of the file with a fixed number of lines? If so you can skip the X number of lines in the Flat File Connection manager.
If not.... can you distinguish the lines so that you can use a Conditional Split to filter out headers lines?
Please mark the post as answered if it answers your question | My SSIS Blog: http://microsoft-ssis.blogspot.com
-
Tuesday, February 28, 2012 8:45 PMI can distinguish between lines that need to be filtered out and those needed to be imported. I have files that have, more or less, blocks of data, where each block starts with a page header that might be a few lines, then a column header. I'm trapping these lines in code using textLine.Contains("abcd");. This works fines, but I figure avoiding coding will help to move this project along faster.
Stan Benner
-
Tuesday, February 28, 2012 9:03 PMModerator
what about a FINDSTRING expression in a conditinal split: http://msdn.microsoft.com/en-us/library/ms141748.aspx
Please mark the post as answered if it answers your question | My SSIS Blog: http://microsoft-ssis.blogspot.com
- Proposed As Answer by Eileen ZhaoMicrosoft Contingent Staff, Moderator Friday, March 02, 2012 8:17 AM
- Marked As Answer by Eileen ZhaoMicrosoft Contingent Staff, Moderator Wednesday, May 02, 2012 9:02 AM
-
Tuesday, February 28, 2012 9:32 PMThanks. Taking a look at that now.
Stan Benner

