Problem Importing a Flat File in SSIS with a Carrige Return.

Robert Oswald 1 Reputation point
2021-11-02T14:40:48.46+00:00

I have a flat file that uses | to separate the fields and does not use a text indicator. (I have no control over the formatting of the flat file.)
The file contains a string field, and the data contained in it some times contains text that includes a carriage return.
When SSIS attempts to import the file, it sees the carriage return in the text field and misinterprets it to mean that the line of data is at its end and it starts a new record.
This then throws the rest of the import off and stops the process.

Note that I can't use a Derived Column Transformation function within SSIS because the data doesn't get past the Flat File Import function.

I'd appreciate any suggestions as to how to handle this issue.

Thank you!

SQL Server Integration Services
SQL Server Integration Services
A Microsoft platform for building enterprise-level data integration and data transformations solutions.
2,452 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Yitzhak Khabinsky 24,946 Reputation points
    2021-11-02T21:51:57.707+00:00

    Hi @Robert Oswald ,

    *.csv/txt flat files always have host of problems where column delimiters, column separators, invisible characters like null terminators \0, special characters based on encoding, and line breaks are in the middle of the actual data.

    The most reliable format for data feeds is XML enforced by XSD. An XSD (as a data contract between sender and receiver) will guarantee data format, enforce data quality, and prevent unexpected changes.

    SSIS has XML Source Adapter for XML files intake.


  2. ZoeHui-MSFT 32,736 Reputation points
    2021-11-03T02:27:40.713+00:00

    Hi @Robert Oswald ,

    Go to Flat File Connection Manager property-->AlwaysCheckForRowDelimiters-->False.

    145991-screenshot-2021-11-03-102508.jpg

    Check my flat file and the result in SSIS below.

    145878-screenshot-2021-11-03-102635.jpg

    If I misunderstand your issue, please incorrect me.

    Regards,

    Zoe


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.