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]

Re: st: runing StatTransfer "set" command from Stata do-file


From   Lucas Ferreira Mation <[email protected]>
To   statalist <[email protected]>
Subject   Re: st: runing StatTransfer "set" command from Stata do-file
Date   Mon, 24 Sep 2012 09:26:12 -0300

Answering my own question bellow on how to customize StatTransfer from
within Stata:

I thank Reg, Chamara, Daniel, Steven and Roger for suggestions on
this. This is what I figure out:

I now realise Stata 12 can handle Excel files, however this may be
useful for batch conversion of other formats.

I asked StatTransfer support and it is not possible to send other
commands besides "copy" from the OS prompt.  So there are two options
to partially automate the process:

1) In a text editor create a file called "profile.stcmd" where you
would include all the desired settings and StatTransfer commands (like
"set WKS-NAME-ROW First-Row"). This file should be save on
StatTransfer's root directory. Whenever StatTrasnfer is run from the
OS prompt (or from within stata with the "stcmd" command), it will
check if such "profile.stcmd" exists, and will execute it. Does it
will override the default setting to whatever commands are inside
"profile.stcmd".

2) In stata copy all files to a temporary folder. Then open the
StatTransfer prompt window and paste the chunk of StatTransfer code
you need all at once. For example:
"
cd C:\my_StatTransfer_temp_files
set WKS-NAME-ROW First-Row
copy *.xls *.dta
"
then save the converted files at the desired directory.

Neither solution is completely automated, however it will only require
manual intervention once.
regards

Lucas


On Thu, Sep 13, 2012 at 11:33 AM, Lucas Ferreira Mation
<[email protected]> wrote:
> Dear all,
>
> my trying to import some .xls files to Stata. I´m using
> StatTtransfer11, and trying to automate the process, controlled from
> my do file.
> The problem is that I need to issue the StatTransfer command  "set
> WKS-NAME-ROW First-Row" before running the actual conversion
> (StatTransfer command "copy").
>
> As far as I can tell, there are two ways to send commands to StatTransfer:
>
> - from the StatTransfer prompt (that blue window), typing specific
> StatTransfer commands like "set" and "copy"
> - from the operating system prompt with the "st" command. This is what
> the Stata command "stcmd" uses to send commands to StatTransfer.
>
> The problem seems to be that I can´t issue a "set" or other
> StatTransfer commands from the OS prompt, only from the StatTransfer
> prompt.
>
> Does anyone knows how this could be solved?
>
> regards
> Lucas Mation
>
> *
> *   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/

*
*   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