Here is a little script that will get you started on what you want to do.
Names Default To Here( 1 );
dt = Current Data Table();
// Loop across the columns
For( i = N Cols( dt ), i >= 1, i--,
Summarize( dt, bygroup = by( As Column( i ) ) );
// Remove blank/missing category
If( bygroup[1] == "" | bygroup[1] == ".",
Remove From( bygroup, 1, 1 )
);
// If only 1 or less values are found, delete the column
If( N Items( bygroup ) <= 1,
dt << delete columns( i )
);
);
Please take the time to make sure you understand how the above code works. You will need to do that to make the changes to the code to get it to do exactly what you want the final product to work.
Scripting documentation is in the Scripting Guide and in the Scripting Index.
Jim