• You could use a script task for this. Go ahead and run your existing SSIS package to the the bad file (without blank lines), then create a new script task and use something similar to below.

    Dim origFile as StreamReader = New StreamReader(add_your_orig_filename_here)

    Dim newFile as StreamWriter = new StreamWriter(add_your_new_filename_here)

    ' Store the last order number

    Dim lastOrderNumber as string

    Dim thisLine as string = origFile.ReadLine()

    lastOrdernumber = thisLine.Substring(0, thisLine.IndexOf(","))

    ' Read through the file and write the output back out to the new file

    ' inserting newlines as appropriate

    While Not origFile.EndOfStream

    dim thisNewLine as string = origFile.ReadLine()

    ' Is this the same order? If not, add a blank line between

    If lastOrderNumber <> thisNewLine.Substring(0, thisNewLine.IndexOf(",")) Then

    newFile.WriteLine()

    lastOrderNumber = thisNewLine.Substring(0, thisNewLine.IndexOf(","))

    End If

    newFile.WriteLine(thisNewLine)

    End While

    ' Flush the file buffer

    newFile.Flush()

    newFile.Close()

    hth,

    Tim

    Tim Mitchell, Microsoft Data Platform MVP
    Data Warehouse and ETL Consultant
    TimMitchell.net | @Tim_Mitchell | Tyleris.com
    ETL Best Practices