Skip to content

Instantly share code, notes, and snippets.

@kmdsbng
Created December 15, 2009 06:25
Show Gist options
  • Save kmdsbng/256738 to your computer and use it in GitHub Desktop.
Save kmdsbng/256738 to your computer and use it in GitHub Desktop.
$KCODE = 'u'
require 'java'
include_class 'java.io.FileInputStream'
include_class 'org.apache.poi.hssf.usermodel.HSSFWorkbook'
def open_xls(filename)
input = FileInputStream.new filename
book = HSSFWorkbook.new input
input.close()
book
end
book = open_xls(ARGV[0])
puts (0...book.getNumberOfSheets).map {|i|
book.getSheetName(i)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment