Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > excel mashup

Reply
Thread Tools

excel mashup

 
 
Dave Sailer
Guest
Posts: n/a
 
      08-23-2007
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/.

 
Reply With Quote
 
 
 
 
Todd Burch
Guest
Posts: n/a
 
      08-23-2007
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/.

 
Reply With Quote
 
 
 
 
Dave Sailer
Guest
Posts: n/a
 
      08-23-2007
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/.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Location Intelligence, the mashup of GIS and Business Intelligence JTP PR Java 0 10-21-2008 12:02 PM
[QUIZ] One-Liners Mashup (#177 again) Matthew Moss Ruby 44 09-29-2008 07:30 PM
[SUMMARY] One-Liners Mashup (#177) Matthew Moss Ruby 5 09-26-2008 10:25 AM
Problem with Excel reports ::::Excel 2003 Migration To Excel 2007 =?Utf-8?B?c2hhc2hhbmsga3Vsa2Fybmk=?= ASP .Net 15 10-24-2007 01:34 PM
New CL + Google Maps Mashup schworer@gmail.com Javascript 0 06-13-2006 08:44 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57