google-drive-ruby icon indicating copy to clipboard operation
google-drive-ruby copied to clipboard

Deleting Columns

Open Duartemartins opened this issue 5 years ago • 0 comments

I'd like to delete columns with fewer than 5 elements and I'm having a bit of a hard time as there is no delete_column() method. This is my code:

(1..132).each do |x|
  @yArr =[]
  (1..10).each do |y|
    if @ws[x,y] == ""
      @yArr << 0 
    else
      @yArr << 1
    end
    if @yArr.sum < 5
      @ws.delete_column(x)
      @ws.save
    else
    end
  end
end

Duartemartins avatar Jan 17 '20 15:01 Duartemartins