The D (and A) modifiers add characters to the list of delimiter characters.
D means Digits and A means Alphabet.
So the command
col1= scan(text,1, , 'D');
is the same as the command
col1= scan(text,1,'0123456789')
Remember that when there are multiple adjacent delimiter it only causes one split in the list.
So
scan('abcd15xyz',1,'0123456789')
Will return abcd as that is the first "word" before the first delimiter.
Also when the string starts with the delimiters the first word is after the first block of delimiters.
So
scan('abcd15xyz',1,,'A')
will return '15' since the leading block of letters is skipped over and the trailing block of letters marks the end of the first word.
The way to remember this is that it is basically doing what you would do when reading a space delimited list of words. For both of these strings:
ONE TWO THREE
ONE TWO THREE
The first word is "ONE" and the second word is "TWO".
... View more