From: Thomas Preymesser Date: 2009-01-11T09:59:39+09:00 Subject: Re: Count Coulmns in Excel file 2008/12/4 Ganesh Ganesh : > Hi, > How to count the number of columns in an excel file.... > and i am using "Spreadsheet::ParseExcel" gem to parse the excel file > > if anybody knows plz reply me in my 'roo' gem (http://rubyforge.org/projects/roo/): --------- require 'rubygems' require 'roo' s = Excel.new("test/numbers1.xls") s.default_sheet = s.sheets.first puts "first column: #{s.first_column}" puts "last column: #{s.last_column}" puts "number of non empty colums: #{s.last_column-s.first_column+1}" puts "number of colums from 'A' to last column: #{s.last_column}" ----------- -Thomas -- Thomas Preymesser thopre@gmail.com http://thopre.googlepages.com/ http://thopre.wordpress.com/