It’s not Friday. But I’ve just written this function and I thought I’d share it. Plus it’s Christmas. Almost.
Some background: I’ve just loaded a spreadsheet into a JMP table and it contains 257 columns. Only 55 of the columns contain data. This function will zap the empty columns and make the table more manageable.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
Remove Empty Columns = Function({dt},{Default Local}, lstToDelete = {}; For (i=1,i<=NCols(dt),i++, col = Column(dt,i); If (Col Number(col)==0, InsertInto(lstToDelete,i) ) ); If (NItems(lstToDelete)>0, dt << Delete Columns(lstToDelete) ); ); |