how to count commas in SSIS 2005

  • i want to count commas after ',R,' (at the end of the row) and but my problem is - row start with word and that word can contain 'R' character. I want to count commas after ",R," in the row.

    ar ,A01008,02189,0646,R,,,,,38

    ab ,A01008,02189,0652,R,,,,,-17

    aa ,A01008,02189,0657,R,,,,,,,,,,,,,-1838

    aa ,A01008,02189,0671,R,,,,,-801

    aa ,A01008,02189,0683,R,,,,,-10

    aa ,A01008,02559,0620,R,,,,,,,,,,,,,,799

    aa ,A01008,02559,0622,R,,,,,,,3551

    aa ,A01008,02559,0626,R,,,,,,,-222

  • You can always reverse the string then count the commas until you encounter the 'R'.

    Regards,
    Matt

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

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