opening filename with a space in it

G

Giel Raijmakers

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
 
7

7stud --

Giel said:
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.
 
G

Giel Raijmakers

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
 
A

Axel Etzold

-------- Original-Nachricht --------
Datum: Mon, 26 Nov 2007 17:31:30 +0900
Von: Giel Raijmakers <[email protected]>
An: (e-mail address removed)
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/kb/142982

says something similar.)

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

Best regards,

Axel
 
S

Siep Korteling

Giel said:
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:

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

Peña, Botp

RnJvbTogR2llbCBSYWlqbWFrZXJzIFttYWlsdG86Z2llbEBkZWdla3N0ZS5jb21dIA0KIyBOb3As
IGRvZXNuJ3Qgd29yayBlaXRoZXIuDQojIHN5c3RlbSgnc3RhcnQgZXhjZWwgYzpcXHRlbXBcXCJv
cGVuIGl0LnhscyInKQ0KIyANCiMgUXVvdGVzIGFyb3VuZCB0aGUgZW50aXJlIHBhdGgrZmlsZW5h
bWUgZG9lc3Qgd29yay4NCiMgc3lzdGVtKCdzdGFydCAiZXhjZWwgYzpcXHRlbXBcXG9wZW4gaXQu
eGxzIicpDQojIFRoYW5rcyBmb3IgdGhlICJwdXNoIiBpbiB0aGUgcmlnaHQgZGlyZWN0aW9uIQ0K
DQp5b3UgbWF5IHF1b3RlIHRoZSBwYXRobmFtZSBvbmx5IGFuZCBtYXkgdXNlIHNpbmdsZSBzbGFz
aA0KDQpzeXN0ZW0oJ3N0YXJ0IGV4Y2VsICJjOlx0ZW1wXG9wZW4gaXQueGxzIicpDQoNCmtpbmQg
cmVnYXJkcyAtYm90cA0KDQo=
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,774
Messages
2,569,598
Members
45,152
Latest member
LorettaGur
Top