Count Coulmns in Excel file

G

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

advanced thanks
Ganesh
 
T

Thomas Preymesser

2008/12/4 Ganesh Ganesh said:
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}"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,774
Messages
2,569,599
Members
45,165
Latest member
JavierBrak
Top