The len() function returns the length of the column in characters not counting trailing spaces.

The datalength() function returns the length of the column in bytes, and all bytes are counted as equal.

Thus, if the column is all spaces, len(col) is 0. To this Kalman added a condition on datalength to rule out rows where the column is the empty string. Whether you actually should add this condition depends on your requirements. Apparently Kalman interpreted
"all spaces" as "at least one space".

The len() function returns the length of the column in characters not counting trailing spaces.

The datalength() function returns the length of the column in bytes, and all bytes are counted as equal.

Thus, if the column is all spaces, len(col) is 0. To this Kalman added a condition on datalength to rule out rows where the column is the empty string. Whether you actually should add this condition depends on your requirements. Apparently Kalman interpreted
"all spaces" as "at least one space".