Forum Discussion
Why are text lengths different?
- 2 years ago
Bit late I suppose but it wasn't an encoding issue. The dataset I was working on had quotation marks as part of the text and it seems that Text.Start and Text.Length both ignore those usually. If I convert the column to a list, however, then suddenly Text.Length counts the quotation marks and that's where the disparity in lengths came from.
I'm also assuming (and this is somewhat hard to verify) that the quotation marks are counted towards length when writing to my warehouse, but since the string Test.Start(_, 2) would cut the string '"testing"' to '"te' this leads to the errors I encountered.
Remember that strings are Unicode (specifically UCS2) so two bytes per character. I guess the extra two bytes come from the string terminator 0x0000
Bit late I suppose but it wasn't an encoding issue. The dataset I was working on had quotation marks as part of the text and it seems that Text.Start and Text.Length both ignore those usually. If I convert the column to a list, however, then suddenly Text.Length counts the quotation marks and that's where the disparity in lengths came from.
I'm also assuming (and this is somewhat hard to verify) that the quotation marks are counted towards length when writing to my warehouse, but since the string Test.Start(_, 2) would cut the string '"testing"' to '"te' this leads to the errors I encountered.
- Anonymous2 years agoNot applicable