Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: RE: RE: change directory from list


From   Nick Cox <n.j.cox@durham.ac.uk>
To   "'statalist@hsphsun2.harvard.edu'" <statalist@hsphsun2.harvard.edu>
Subject   st: RE: RE: change directory from list
Date   Mon, 21 Feb 2011 20:46:03 +0000

Or protected, depending which line of code you are looking at. 

Nick 
n.j.cox@durham.ac.uk 


-----Original Message-----
From: owner-statalist@hsphsun2.harvard.edu [mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of Nick Cox
Sent: 21 February 2011 20:30
To: 'statalist@hsphsun2.harvard.edu'
Subject: st: RE: change directory from list

I think the issue remains the need to use " " around strings with embedded spaces, rather than any lack of support for scalars. 

Try 

    cd "`=mypath'"

-- as when the scalar is evaluated the spaces are now unprotected. 

Nick 
n.j.cox@durham.ac.uk 

Hanno Scholtz

I want to have a do-file performed in a number of directories, but it turns
out that the change directory command cd does not accept string scalars. 
Of course, 
  
    cd "c:\my data\stata"

works, but

    scalar mypath="c:\my data\stata"
    cd `=mypath'

does not. Does anyone know how to solve this? 

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index