Flat file to Excel destination!

  • I ahve a flat file and I need to import the file to Excel.

    In the flat file there are a bunch of unwanted data.

    e.g

    -----------------------------------------

    ABCD

    -----------------------------------------

    01-24-2011 SERAIl#

    P.SN PAGE 30

    ----------------------------------------

    ITEM ID SERIAL# DATE S Description

    ----------------------------------------

    AB111 77777 01-24-11 I ABCD

    CD111 77779 01-12-11 I DDDD

    I don't want anything that has

    -----------------------------------------

    ABCD

    -----------------------------------------

    01-24-2011 SERAIl#

    P.SN PAGE 30

    ----------------------------------------

    ITEM ID SERIAL# DATE S Description

    ----------------------------------------

    in it.

    I just want the Column values without the nulls in between.No header.

    I am trying to insert these in a sql table. This is coming in as a single column. Then delete from the table anything that has

    WHENEVER I try to delete from the table anything that has

    -----------------------------------------

    ABCD

    -----------------------------------------

    01-24-2011 SERAIl#

    P.SN PAGE 30

    ----------------------------------------

    ITEM ID SERIAL# DATE S Description

    ----------------------------------------

    in it.

    When I write

    DELETE FROM TableName Where ColumnName Like '%--%' OR

    COLUMNName LIKE '%ABCD'

    etc . It does not get deleted.

    How do I do that.

    Then I need to import the good data to Excel.

  • I'm not sure if I'm missing the point here, but wouldn't it be easier to use an Excel-Macro for it?

    It just makes me wonder why to use SSIS to convert flat file data into MS Office format... :unsure:



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

  • Or it might be possible via a conditional split (just redirect all the unwanted rows to an unused output and keep the good stuff) - don't use SQL Server at all.

    The absence of evidence is not evidence of absence
    - Martin Rees
    The absence of consumable DDL, sample data and desired results is, however, evidence of the absence of my response
    - Phil Parkin

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply