No announcement yet.
  • Filter
  • Time
  • Show
Clear All
new posts

  • Stata seems to add spaces into path where there are none, wich leads to error message

    Dear statalist,

    I am using Stata/SE 15.1 for Mac. I am using a global to specify my path at the beginning of my do file. I write it like this:
    global path "/Users/felix/Dropbox⁩/Felix⁩/F&Vs PHD⁩/EINITE⁩/Aggregation⁩/Paper⁩/Aggregation_21082019⁩/"
    However, in the command window Stata returns it like this, with additional spaces, e.g. after "felix":
    global path "/Users/felix ⁩/Dropbox ⁩/Felix⁩/F&Vs PHD ⁩⁩/ ⁨EINITE⁩/ ⁨Aggregation⁩/Paper⁩/Aggregation_21082019"
    This later causes problems when I later refer to my path using other commands, such as import excel, as STATA tells me that it cannot find the specified file:
    I specify my command like this:
    import excel "$path/TOTAL WITH PROPERTYLESS/Germany_total_1400.xlsx", firstrow
    and then STATA returns the command like this, with additional spaces in the command window with an error message "not found":
    file /Users/felix ⁩/Dropbox ⁩/Felix⁩/F&Vs PHD ⁩⁩/ ⁨EINITE⁩/ ⁨Aggregation⁩/Paper⁩/Aggregation_21082019/TOTAL WITH PROPERTYLESS/Germany_total_1400.xlsx
    So sum up, the problem seems to be that STATA adds spaces to my command that are not included in the folder names and this seems to misspecify the path when I try to draw on it. I checked spelling and everything is in double-quotes.

    Many thanks in advance for your help.