Normally, the characters 21-22 of line 2 of .sdf and .mol files indicate if the structure is a 2D or 3D. If neither “2D” nor “3D” is found there, the third column of the atom coordinates at zero indicate a 2D stucture. (see lines 5 - always the same char position… - check which…)