[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

CVS to XLS in Ruby

haley.miller

6/28/2006 5:05:00 PM

I currently have a script that reads in a CVS file and attempts to save
it out as an XLS file. The main purpose of the script is to do
formatting. However, when I save the file to a .xls, excel shows me a
file where all my data is in the first column of each and none of my
formatting has held. I suspect this is because my file is still in
some way in CVS format. Is there a way within ruby to tell it that the
file I have opened needs to be covereted from CVS to XLS or a way to do
this when I save the file? Any help would be appreciated!

Haley

3 Answers

a a r o n . k e m p f @ g m a i l . c o m

6/28/2006 10:01:00 PM

0

lol i'd be QUITE impressed if you find a way.

i think that excel is crap so who cares.. but still-- i woudl be QUITE
impressed with ruby if there was a somewhat easy way to do this




haley.miller@gmail.com wrote:
> I currently have a script that reads in a CVS file and attempts to save
> it out as an XLS file. The main purpose of the script is to do
> formatting. However, when I save the file to a .xls, excel shows me a
> file where all my data is in the first column of each and none of my
> formatting has held. I suspect this is because my file is still in
> some way in CVS format. Is there a way within ruby to tell it that the
> file I have opened needs to be covereted from CVS to XLS or a way to do
> this when I save the file? Any help would be appreciated!
>
> Haley

a a r o n . k e m p f @ g m a i l . c o m

6/28/2006 10:05:00 PM

0


looks like you do something like this

require 'win32ole'
wb = WIN32OLE.connect("excel.application")
wb.SaveAs

I would open a spreadsheet; record a macro and copy and paste it from
there.

ps- this is going to require windows and excel.. .right?





aaron.ke...@gmail.com wrote:
> lol i'd be QUITE impressed if you find a way.
>
> i think that excel is crap so who cares.. but still-- i woudl be QUITE
> impressed with ruby if there was a somewhat easy way to do this
>
>
>
>
> haley.miller@gmail.com wrote:
> > I currently have a script that reads in a CVS file and attempts to save
> > it out as an XLS file. The main purpose of the script is to do
> > formatting. However, when I save the file to a .xls, excel shows me a
> > file where all my data is in the first column of each and none of my
> > formatting has held. I suspect this is because my file is still in
> > some way in CVS format. Is there a way within ruby to tell it that the
> > file I have opened needs to be covereted from CVS to XLS or a way to do
> > this when I save the file? Any help would be appreciated!
> >
> > Haley

greg.rb

6/29/2006 2:03:00 PM

0


aaron.kempf@gmail.com wrote:
> lol i'd be QUITE impressed if you find a way.
>
> i think that excel is crap so who cares.. but still-- i woudl be QUITE
> impressed with ruby if there was a somewhat easy way to do this

excel is a fantastic functional programming application.

ruby can convert CVS through the win32ole - if you have excel. this is
how i manipulate excel.

i haven't used them but there are modules which can write directly
excel files.