I have been importing electrophysiology data into Origin 6.1 using the Bruxton Data Access 6.1 add on software. I often end up with a few extra columns at the end of my worksheets, and I was wondering if there was a simple way to detect empty columns and delete them using labtalk?
Here's one way. It checks each column starting with the last and deletes it if it contains no data points.
for(ii=wks.ncols;ii>0;ii--) { sum(wcol(ii)); // apply the sum() function to column #ii if(sum.n>0) break; // exit the loop if the column contains any data points del wcol(ii); // delete the column if not };