while contLoop do
colVal = worksheet.Cells(row, column).Value
if (colVal) then
# This field is not NIL, this means that this row contains a entry
# Get the SecurityObject corresponding to the cusip, and
get the coupon
do processing ....
else
# This signifies the end - no cash column value, no short
name value.
# End the loop
contLoop = false
end
# go to the next Row
row += 1
end
# we are done
application.Workbooks.Close
And also any suggestions on where/how to learn Ruby would be very
helpful and appreciated.
Can somebody share their expertise on how to open and read data from
excel using ruby?
I would also recommend parseexcel. The maintainer is very friendly and the
package works quite well.
require "parseexcel/parseexcel"
file_name = "/your/file/name/here.xls"
workbook = Spreadsheet::ParseExcel.parse(file_name)
worksheet = workbook.worksheet(0) # the first sheet in the book
worksheet.each { |row| puts row.at(0) } # print the first column of each row
And also any suggestions on where/how to learn Ruby would be very
On 6/5/06, Madan Manoharan <madan.manoharan@gmail.com> wrote:
On 6/5/06, Parvinder Ghotra <ghotrapa@yahoo.com> wrote:
> Hi,
> I'm brand new to Ruby.
> Can somebody share their expertise on how to open and read data from
> excel using ruby?
> Thanks in advance.
while contLoop do
colVal = worksheet.Cells(row, column).Value
if (colVal) then
# This field is not NIL, this means that this row contains a
entry
# Get the SecurityObject corresponding to the cusip, and
get the coupon
do processing ....
else
# This signifies the end - no cash column value, no short
name value.
# End the loop
contLoop = false
end
# go to the next Row
row += 1
end
# we are done
application.Workbooks.Close
And also any suggestions on where/how to learn Ruby would be very
helpful and appreciated.