ruby spreadsheet library

Thumbs up for http://spreadsheet.rubyforge.org/ A ruby library for accessing .xls files. Really comfortable. Just missing a way to access columns by excel-like captions

sheet.row(0)["AA"]

Maybe i just didn’t find it, but nevertheless you can of course extend String, though

class String
  def to_excel_index
    each_char.collect{ |c| ("A".."Z").to_a.index(c) }.
      inject { |sum, n| sum + (sum + 1) * 25 + n + 1 }
  end
end

and use

sheet.row(0)["AA".to_excel_index]

One Response to “ruby spreadsheet library”

  1. PEDRO Says:


    MedicamentSpot.com. Canadian Health&Care.Best quality drugs.No prescription online pharmacy.Special Internet Prices. No prescription drugs. Order drugs online

    Buy:Tramadol.Zithromax.Cialis Professional.Viagra Professional.VPXL.Propecia.Viagra Super Force.Levitra.Cialis Super Active+.Soma.Super Active ED Pack.Viagra Soft Tabs.Maxaman.Cialis.Viagra.Viagra Super Active+.Cialis Soft Tabs….

Leave a Reply

CAPTCHA Image Audio Version
Reload Image