Sign in to follow this  
Followers 0
NSearch

Spaces in filenames

5 posts in this topic

Hello. Hopefully this will be an easy fix so that I can get back rollin on this bit of code. I am trying to run() an excel spreadsheet, but when I go to call up the file AutoIt is breaking apart the file name.

(i.e "test page.xls" gives me an error that test.xls and page.xls could not be found)

I have renamed the file test_page.xls and it works fine, but I do not want to have to go through and rename all the files, because there are macros that depend on the specific file name.

Thanks.

Share this post


Link to post
Share on other sites



Try this one:

MsgBox(0, "Regular Expression Replace Test", StringRegExpReplace("test page.xls", " ", "_"))

Share this post


Link to post
Share on other sites

eJan,

Thanks for your reply, but that did not work. Are there a set of characters to enter in the place of a space so that AutoIt sees the space instead of two seperate words?

Thanks

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

eJan,

  Thanks for your reply, but that did not work. Are there a set of characters to enter in the place of a space so that AutoIt sees the space instead of two seperate words?

Thanks

<{POST_SNAPBACK}>

use double quotes around the file name and single around the command like:

Run('exel.exe "c:\temp\file name with spaces.xls" ')
Edited by JdeB

Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

WONDERFUL! Thank you very much JdeB. Works perfect now.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0