Skip to content

Instantly share code, notes, and snippets.

@nurettin
Created March 12, 2013 13:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nurettin/5142687 to your computer and use it in GitHub Desktop.
Save nurettin/5142687 to your computer and use it in GitHub Desktop.
opening xls with JRuby and apache poi
require 'java'
require 'lib/java/poi/poi-3.9/poi-3.9-20121203.jar'
java_import 'org.apache.poi.poifs.filesystem.POIFSFileSystem'
java_import 'org.apache.poi.hssf.usermodel.HSSFCell'
java_import 'org.apache.poi.hssf.usermodel.HSSFWorkbook'
java_import 'org.apache.poi.hssf.usermodel.HSSFCellStyle'
java_import 'org.apache.poi.hssf.usermodel.HSSFDataFormat'
java_import 'java.io.FileInputStream'
java_import 'java.util.Date'
p "opening pk.xls"
xls_file= FileInputStream.new("pk.xls")
xls= HSSFWorkbook.new(xls_file)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment