ls -F
marks directories with a trailing slash. Then use sed
to convert the slash into ",1" and to get rid of the other marks (for symlinks etc) or replace them by a suffix of your choice. Finally append ",0" to everything which does not end in ",1" (or any other suffix you added)
This suffixes directories with ",1" and everything else with ",0"
ls -F | sed '
s/[\*\@\|]$//;
s/=>$//;
s/\/$/,1/;
/,1$/! s/$/,0/'