excel mashup

Discussion in 'Ruby' started by Dave Sailer, Aug 23, 2007.

  1. Dave Sailer

    Dave Sailer Guest

    I'm using parseexcel (http://raa.ruby-lang.org/project/parseexcel/) to
    read some excel files from a website after manually downloading them.
    I'd like to avoid the download and read them directly off the web but
    can't see how to do this. parseexcel uses File.open which requires a
    disk file I guess. In java there are high level interfaces that allow
    you to treat any type of data as an io stream.

    is there something I'm missing here? another way to do this?
    --
    Posted via http://www.ruby-forum.com/.
     
    Dave Sailer, Aug 23, 2007
    #1
    1. Advertising

  2. Dave Sailer

    Todd Burch Guest

    Dave Sailer wrote:
    > I'm using parseexcel (http://raa.ruby-lang.org/project/parseexcel/) to
    > read some excel files from a website after manually downloading them.
    > I'd like to avoid the download and read them directly off the web but
    > can't see how to do this. parseexcel uses File.open which requires a
    > disk file I guess. In java there are high level interfaces that allow
    > you to treat any type of data as an io stream.
    >
    > is there something I'm missing here? another way to do this?


    Here's a little code to get you started:

    require 'open-uri' ;

    script = nil ;
    result = nil ;

    page = "http://www.google.com"

    begin ;
    result = open(page) {|w| script = w.readlines } ;
    rescue => e ;
    puts "e=#{e}, e.class=#{e.class}" ;
    result = [] ;
    end ;

    puts "result class=#{result.class}, count=#{result.length}" ; #,
    data=#{result}" ;
    puts "result[0] =>#{result[0].chomp}<=" if result[0] ;

    I just figured this out the other day when reading Hal Fulton's The Ruby
    Way - second edition.

    Easy as pie. Pages 706-707.

    Todd.
    --
    Posted via http://www.ruby-forum.com/.
     
    Todd Burch, Aug 23, 2007
    #2
    1. Advertising

  3. Dave Sailer

    Dave Sailer Guest

    Todd Burch wrote:

    >
    > I just figured this out the other day when reading Hal Fulton's The Ruby
    > Way - second edition.
    >
    > Easy as pie. Pages 706-707.
    >
    > Todd.


    thanks!
    how is that book? I've found the pick axe a bit cryptic.
    --
    Posted via http://www.ruby-forum.com/.
     
    Dave Sailer, Aug 23, 2007
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?c2hhc2hhbmsga3Vsa2Fybmk=?=

    Problem with Excel reports ::::Excel 2003 Migration To Excel 2007

    =?Utf-8?B?c2hhc2hhbmsga3Vsa2Fybmk=?=, Oct 5, 2007, in forum: ASP .Net
    Replies:
    15
    Views:
    1,604
    =?Utf-8?B?c2hhc2hhbmsga3Vsa2Fybmk=?=
    Oct 24, 2007
  2. JTP PR
    Replies:
    0
    Views:
    527
    JTP PR
    Oct 21, 2008
  3. Matthew Moss

    [QUIZ] One-Liners Mashup (#177 again)

    Matthew Moss, Sep 20, 2008, in forum: Ruby
    Replies:
    44
    Views:
    439
    Ken Bloom
    Sep 29, 2008
  4. Matthew Moss

    [SUMMARY] One-Liners Mashup (#177)

    Matthew Moss, Sep 26, 2008, in forum: Ruby
    Replies:
    5
    Views:
    150
    Sebastian Hungerecker
    Sep 26, 2008
  5. New CL + Google Maps Mashup

    , Jun 13, 2006, in forum: Javascript
    Replies:
    0
    Views:
    89
Loading...

Share This Page