[lnkForumImage]
TotalShareware - Download Free Software

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


 

Forums >

comp.lang.ruby

opening filename with a space in it

Flaming Flamingo

11/26/2007 8:32:00 AM

Hi all,
Iâ??m a Ruby newbie so this is probably not the most challenging question
on the net, but, here it goes.
How can I open a filename with a space in it?
It concerns an Excel file.

system('start excel c:\\temp\\open it.xlsâ??)

Excel will try to open â??open.xlsâ? and â??it.xlsâ?.

Thanks for the help guys!

FlamingFlamingo
--
Posted via http://www.ruby-....

6 Answers

7stud --

11/26/2007 8:34:00 AM

0

Giel Raijmakers wrote:
> Hi all,
> Iâ??m a Ruby newbie so this is probably not the most challenging question
> on the net, but, here it goes.
> How can I open a filename with a space in it?
> It concerns an Excel file.
>
> system('start excel c:\\temp\\open it.xlsâ??)
>
> Excel will try to open â??open.xlsâ? and â??it.xlsâ?.
>
> Thanks for the help guys!
>
> FlamingFlamingo

Try some quotes around the file name.

--
Posted via http://www.ruby-....

Flaming Flamingo

11/26/2007 8:44:00 AM

0

Nop, doesn't work either.
system('start excel c:\\temp\\"open it.xls"')

Quotes around the entire path+filename doest work.
system('start "excel c:\\temp\\open it.xls"')
Thanks for the "push" in the right direction!


Flaming Flamingo
>
> Try some quotes around the file name.

--
Posted via http://www.ruby-....

Axel Etzold

11/26/2007 9:23:00 AM

0


-------- Original-Nachricht --------
> Datum: Mon, 26 Nov 2007 17:31:30 +0900
> Von: Giel Raijmakers <giel@degekste.com>
> An: ruby-talk@ruby-lang.org
> Betreff: opening filename with a space in it

> Hi all,
> Iâ??m a Ruby newbie so this is probably not the most challenging question
> on the net, but, here it goes.
> How can I open a filename with a space in it?
> It concerns an Excel file.

Dear Giel,

welcome to Ruby - I am sure you'll enjoy it :).

I vaguely recall that I also had the problem you write about and
could solve it by substituting
an underscore for the space, thus:

system('start excel c:\\temp\\open_it.xlsâ??)

(Couldn't test it now, but this :

http://support.microsoft.com...

says something similar.)

But that's not a Ruby-specific issue, rather an operating system specific
one.

Best regards,

Axel

>
> system('start excel c:\\temp\\open it.xlsâ??)
>
> Excel will try to open â??open.xlsâ? and â??it.xlsâ?.
>
> Thanks for the help guys!
>
> FlamingFlamingo
> --
> Posted via http://www.ruby-....

--
GMX FreeMail: 1 GB Postfach, 5 E-Mail-Adressen, 10 Free SMS.
Alle Infos und kostenlose Anmeldung: http://www.gmx.net/de/g...

Siep Korteling

11/26/2007 9:24:00 AM

0

Giel Raijmakers wrote:
> Nop, doesn't work either.
> system('start excel c:\\temp\\"open it.xls"')
>
> Quotes around the entire path+filename doest work.
> system('start "excel c:\\temp\\open it.xls"')
> Thanks for the "push" in the right direction!
>
>
> Flaming Flamingo
>>
>> Try some quotes around the file name.

Try:

system('start excel "c:\\temp\\open it.xls"')



--
Posted via http://www.ruby-....

Peña, Botp

11/26/2007 9:33:00 AM

0

RnJvbTogR2llbCBSYWlqbWFrZXJzIFttYWlsdG86Z2llbEBkZWdla3N0ZS5jb21dIA0KIyBOb3As
IGRvZXNuJ3Qgd29yayBlaXRoZXIuDQojIHN5c3RlbSgnc3RhcnQgZXhjZWwgYzpcXHRlbXBcXCJv
cGVuIGl0LnhscyInKQ0KIyANCiMgUXVvdGVzIGFyb3VuZCB0aGUgZW50aXJlIHBhdGgrZmlsZW5h
bWUgZG9lc3Qgd29yay4NCiMgc3lzdGVtKCdzdGFydCAiZXhjZWwgYzpcXHRlbXBcXG9wZW4gaXQu
eGxzIicpDQojIFRoYW5rcyBmb3IgdGhlICJwdXNoIiBpbiB0aGUgcmlnaHQgZGlyZWN0aW9uIQ0K
DQp5b3UgbWF5IHF1b3RlIHRoZSBwYXRobmFtZSBvbmx5IGFuZCBtYXkgdXNlIHNpbmdsZSBzbGFz
aA0KDQpzeXN0ZW0oJ3N0YXJ0IGV4Y2VsICJjOlx0ZW1wXG9wZW4gaXQueGxzIicpDQoNCmtpbmQg
cmVnYXJkcyAtYm90cA0KDQo=

Flaming Flamingo

11/26/2007 10:12:00 AM

0

Siep Korteling wrote:
> Giel Raijmakers wrote:
>> Nop, doesn't work either.
>> system('start excel c:\\temp\\"open it.xls"')
>>
>> Quotes around the entire path+filename doest work.
>> system('start "excel c:\\temp\\open it.xls"')
>> Thanks for the "push" in the right direction!
>>
>>
>> Flaming Flamingo
>>>
>>> Try some quotes around the file name.
>
> Try:
>
> system('start excel "c:\\temp\\open it.xls"')

This one works!

Cheers!

--
Posted via http://www.ruby-....