none
Importing text file data using SSIS question.

    Frage

  • Is 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

    Dienstag, 28. Februar 2012 19:50

Antworten

Alle Antworten

  • 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

    Dienstag, 28. Februar 2012 19:56
    Moderator
  • I 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

    Dienstag, 28. Februar 2012 20:45
  • 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

    • Als Antwort vorgeschlagen Eileen Zhao Freitag, 2. März 2012 08:17
    • Als Antwort markiert Eileen Zhao Mittwoch, 2. Mai 2012 09:02
    Dienstag, 28. Februar 2012 21:03
    Moderator
  • Thanks.  Taking a look at that now.

    Stan Benner

    Dienstag, 28. Februar 2012 21:32