Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Spaces in folder names? 1

Status
Not open for further replies.

clk430

Programmer
Sep 21, 2005
235
US
Does Mercator have problems writing to folders with spaces in the names? For instance, my output simply renames the file and places it in a destination folder:

=RUN("MyCopy","-WM -IE1S" + NUMBERTOTEXT( SIZE(CPIn)) + " " + CPIn + "-OF1 " + "E:\EC\AppData\Polk\TEST Folder\" + "VIN_AND_SYMBOL_REPORT_" + LEFT((LEAVEALPHANUM(DATETOTEXT(CURRENTDATE()))),4)

\Test Folder\ gives me an error. \TestFolder\ does not.

Is there a work around for this?
 
Single quotes around the text with a space. Personally I never liked files or directories with spaces. I also like ot keep the names as short as possible.



BocaBurger
<===========================||////////////////|0
The pen is mightier than the sword, but the sword hurts more!
 
I'm with you, I don't like them either.

I tried:

"E:\EC\AppData\Polk\'TEST Folder'\"
"E:\EC\AppData\Polk'\TEST Folder\'"
"'E:\EC\AppData\Polk\TEST Folder\'"

But to no avail. Everytime, I get a failed at run function with a 56 error.
 
Is it because you don't have a space before -OF1?

=RUN("MyCopy","-WM -IE1S" + NUMBERTOTEXT( SIZE(CPIn)) + " " + CPIn + " -OF1 " + "E:\EC\AppData\Polk\TEST Folder\" + "VIN_AND_SYMBOL_REPORT_" + LEFT((LEAVEALPHANUM(DATETOTEXT(CURRENTDATE()))),4)
 
Nope, I tried that as well, but it did not work. Simply writing to

E:\EC\AppData\Polk\TESTFolder rather than
E:\EC\AppData\Polk\TEST Folder

Works perfectly. The problem is, we don't own that folder and they don't want to change it. There is going to be a stand off soon. :)
 
Have you tried using the DOS representation of the folder name. Have you tried copy/paste the folder name in case it has 2 spaces?
 
If you use single quotes I think it has to be round the full file name.
=RUN("MyCopy","-WM -IE1S" + NUMBERTOTEXT( SIZE(CPIn)) + " " + CPIn + " -OF1 'E:\EC\AppData\Polk\TEST Folder\VIN_AND_SYMBOL_REPORT_" + LEFT((LEAVEALPHANUM(DATETOTEXT(CURRENTDATE()))),4) + "'")
 
I've tried copy/paste. I've even recreated my own folder on my own directory that I can manipulate, and whenver the last folder name has spaces, I get the 56 error. What do you mean my DOS representation?
 
like C:\PROGRA~1\MERCAT~1.7 for c:\PROGRAM FILES\MERCATOR6.7.

See above re single quotes as well.
 
Janhes, you're awesome!! The single quote example you provided worked!!! Thanks so much....it was so simple, yet I coudln't figure it out. I need a vacation! :) Thanks again and Happy Holidays!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top