21 Replies Latest reply: Jan 28, 2015 8:30 PM by John Repucci RSS

    Subfield with consecutive delimiters - a bug?

    John Repucci

      If I have a string with the occasional multiple delimiters between data, Subfield extracts the delimiter and not the expected data.

       

      Example:

      =subfield('abcdef    MyData zzzz', ' ' , 2)

      I expect the above to return 'MyData', but it returns ' ' (a space)

       

      I could use the following very ugly statement, but I'm not thrilled about doing so, especially since this needs to be done during a load.

      =Subfield(TRIM( MID('abcdef    MyData zzzz',INDEX('abcdef    MyData zzzz',' ',1)) ),' ',1)

       

      Based on my experience with many other languages, I expected the subfield to eat the extra consecutive  delimiters, but that is not happening.

       

      Q1) is this the expected Subfield behavior or a bug?

      Q2) Does anyone have a better method than my above expression?

       

      TIA,

       

      John

      QV 11.20, SR4