[lnkForumImage]
TotalShareware - Download Free Software

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


 

Forums >

comp.lang.ruby

Problem writing a text file

RichardOnRails

3/24/2009 3:17:00 AM

Hi,

I imported some test data from Excel as a CSV file.
I massaged that data and tried to write it out as CSV text file.
However, no file was created on the file system.

I've put out a snippet of the relevant code and debugging output at
http://www.pastie.....

I'm running ruby 1.8.6 in WinXP-Pro/SP3.

Does anybody see any obvious (or subtle) error?

Thanks in Advance,
Richard
2 Answers

Hassan Schroeder

3/24/2009 3:57:00 AM

0

On Mon, Mar 23, 2009 at 8:16 PM, RichardOnRails
<RichardDummyMailbox58407@uscomputergurus.com> wrote:

> I've put out a snippet of the relevant code and debugging output at
> http://www.pastie.....

> Does anybody see any obvious (or subtle) error?

Quick glance: File.open('fn', 'w') -- you're opening a file named 'fn',
not the file with the name represented by the variable fn .

HTH,
--
Hassan Schroeder ------------------------ hassan.schroeder@gmail.com

RichardOnRails

3/24/2009 5:24:00 AM

0

On Mar 23, 11:56 pm, Hassan Schroeder <hassan.schroe...@gmail.com>
wrote:
> On Mon, Mar 23, 2009 at 8:16 PM, RichardOnRails
>
> <RichardDummyMailbox58...@uscomputergurus.com> wrote:
> > I've put out a snippet of the relevant code and debugging output at
> >http://www.pastie.....
> > Does anybody see any obvious (or subtle) error?
>
> Quick glance: File.open('fn', 'w') -- you're opening a file named 'fn',
> not the file with the name represented by the variable fn .
>
> HTH,
> --
> Hassan Schroeder ------------------------ hassan.schroe...@gmail.com

Hi Hassan,

Once more, you've pulled my fat out of the fire. I apologize for
bothering people on this newsgroup with my stupidity.

Thank you very much for you help.

Best wishes,
Richard