Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: Novel feature of -shell- under Windows


From   Roger Newson <[email protected]>
To   [email protected]
Subject   Re: st: Novel feature of -shell- under Windows
Date   Tue, 13 Jul 2004 10:55:00 +0100

Thanks to Christian for those alternative workarounds. The first might be even better in the form:

nobreak {
local oldpwd `"`c(pwd)'"'
cd "C:\Program Files\StatTransfer7\"
shell st /o /y auto.dta "my auto.xls"
cd "`oldpwd'"
}

or something similar.

Roger

At 10:01 13/07/2004, Christian Holz wrote:

Dear Roger,

another workaround (which may also be used within do files) is

cd "C:\Program Files\StatTransfer7\";
shell st /o /y auto.dta "my auto.xls";

This avoids the necessity of using quotes for the DOS command name.
You should also consider (which is the way, I decided to use) to copy all
basic StatTransfer files into your working directory do use the above shell
command without the prior change directory.
The necessary StatTransfer files are:

- LICENSE.DAT
- st.exe
- stadev32.dll
- statrn32.dll
- stutil.dll


Kind regards,

Christian Holz
Research Analyst        | HBS Consulting GmbH
tel: +49 341 215 4549   | Tomasiusstrasse 2, D-04109 Leipzig, Germany
fax: +49 341 215 4521   | www.hbs-consulting.com
cell +49 172 792 3672   | [email protected]


> I think I have discovered an unwanted new feature of the -shell- command,
> at least in the 01 July 2004 version of Stata 8.2 under Windows 2000. It
> appears not to work when both the DOS command path and the filename are
> enclosed in quotes.
>
> For instance, if the user has StatTransfer 7 installed in a folder
>
> C:\Program Files\StatTransfer7\
>
> and has the auto data in a file auto.dta in the local directory, then the
> command
>
> shell "C:\Program Files\StatTransfer7\st" /o /y auto.dta my_auto.xls
>
> will create a Microsoft Excel version of the auto data in the file
> my_auto.xls. However, the command
>
> shell "C:\Program Files\StatTransfer7\st" /o /y auto.dta "my auto.xls"
>
> will not create a Microsoft Excel version of the auto data in a file "my
> auto.xls". The problem is the quotes and not the embedded spaces in the
> filename (which make the quotes necessary), because the command
>
> shell "C:\Program Files\StatTransfer7\st" /o /y auto.dta "my_auto.xls"
>
> does not create a Microsoft Excel version of the auto data in a file
> my_auto.xls.
>
> This feature of -shell- is specific to the -shell- command syntax
>
> shell operating_system_command
>
> because, if I simply type
>
> shell
>
> and open a DOS window and then, in that DOS window, type
>
> "C:\Program Files\StatTransfer7\st" /o /y auto.dta "my auto.xls"
>
> then a Microsoft Excel version of the -auto- data is created in the file
> "my auto.xls".
>
> This feature of the -shell- command has partially disabled my -stcmd-
> package, which is downloadable from SSC and also shipped with official
> StatTransfer 7, but which will no longer work with filenames in quotes,
> which used to cause no problems. I personally would never define a
> filename
> containing spaces (and therefore necessitating quotes), but some of my
> SPSS-using collaborators do this with the .sav files which they send me.
> (As a quick and dirty fix, I suppose I always could rename these .sav
> files, substituting underscores for blanks.)



*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/

--
Roger Newson
Lecturer in Medical Statistics
Department of Public Health Sciences
King's College London
5th Floor, Capital House
42 Weston Street
London SE1 3QD
United Kingdom

Tel: 020 7848 6648 International +44 20 7848 6648
Fax: 020 7848 6620 International +44 20 7848 6620
  or 020 7848 6605 International +44 20 7848 6605
Email: [email protected]
Website: http://www.kcl-phs.org.uk/rogernewson

Opinions expressed are those of the author, not the institution.

*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index