0

I have an existing SSIS package that reads a flat file and transforms the data based on the 1st 2 characters on each line.

Everything works fine, except when the script component tries to process the following 2 rows of data:

16,501,115616131,,,/
88,WEB FR DDA TO DDA 002223136835 CONFIRMATION# 075623382664 07/

Essentially, the fix for this is manual, where I remove the / from the end of first line and 88 on the next line and save the file and reprocess it. The changes to the above look like below:

 16,501,115616131,,,,WEB FR DDA TO DDA 002223136835 CONFIRMATION# 075623382664 07/

The code that handles these 2 lines does not seem to work and I am trying to find a fix for the same:

if (recordType == "88" && previousRecordType == "16")
    {
        var columnDetails = Row.RowData.Substring(0, Row.RowData.LastIndexOf('/')).Trim();
        TransactionDetailOutputBuffer.ExtraComments = columnDetails;
    }

Could you suggest some changes that would help me merge the 2 rows together?

Thanks, RV

rvphx
  • 2,324
  • 6
  • 40
  • 69
  • When you get a short line, is it always the case that a line ending with `/` ? Are you manually reading the lines of the file in your Script Component (acting as source)or are you using a Script Component (acting as Transformation)? If Transformation, are you set for Synchronous Input (default) or Asynchronous? – billinkc Nov 30 '22 at 19:56
  • It is a script component and the file is read through a flat file source. The ending character on every line is always a / and the beginning is always 2 digits. – rvphx Nov 30 '22 at 20:28
  • maybe try a .Replace("/\n88","") on whole source. – KeithL Dec 01 '22 at 14:21

0 Answers0