none
How to remove row delimiter from the last row?

    Question

  • I am generating a file with only one column and having as row delimiter {CR}{LF}.
    The file is supposed to have only 2  rows (different length) and is intended to serve as input of a third party application.

    The problem is that the application is expecting something like this:
    line1datatatatatatatatatata{CR}{LF}
    line2datatata

    and SSIS packege is generating:
    line1datatatatatatatatatata{CR}{LF}
    line2datatata{CR}{LF}
    causing the application to reject the file.

    When I edit the file and manually remove the line delimiters {CR}{LF} the from the second row, the application consumes the file without any issues.

    So, the question is: How do I do it autommatically?

    Thanks

    Friday, June 28, 2013 10:25 PM

Answers

  • I think by architecture SSIS Flat file Connection Manager interpretes file this way. So this will attract a Script Task after the Dataflow to add few lines of code to check the EOF and remove {CR}{LF}.

    Thanks

    Subhash Subramanyam


    Please mark this post as answer / mark it as helpful if it resolves your Problem. Thanks Subhash Subramanyam

    Saturday, June 29, 2013 9:08 AM

All replies

  • How does the 3rd party app read the second row with no cr/lf?? Is it a fixed length? Curious question.

    Any case you will need to write a script to strip the cr/lf.


    Hope this is Helpfull. J Alverson Microsoft BI Solutions Please use Marked as Answer if my post solved your problem and use Vote As Helpful if a post was useful.

    Friday, June 28, 2013 10:33 PM
  • I did try that, but the script comes before the otput file definition which is the one that inserts {cr}{LF} at the end of the line

    Friday, June 28, 2013 10:39 PM
  • I think by architecture SSIS Flat file Connection Manager interpretes file this way. So this will attract a Script Task after the Dataflow to add few lines of code to check the EOF and remove {CR}{LF}.

    Thanks

    Subhash Subramanyam


    Please mark this post as answer / mark it as helpful if it resolves your Problem. Thanks Subhash Subramanyam

    Saturday, June 29, 2013 9:08 AM
  • I must be missing something. You need the script to run after you generate the output file.

    Hope this is Helpfull. J Alverson Microsoft BI Solutions Please use Marked as Answer if my post solved your problem and use Vote As Helpful if a post was useful.

    Sunday, June 30, 2013 6:53 PM