Dear Daniel,
thank you for answer and providing an example and sory for the slopy
question. My original problem (adapted to your example) was:
. cd c:/ado
. sysuse auto ,clear
. sa 42.dta
. sa 43.dta
. di "`list2'"
dta" "43: operator invalid
This was a problem with the display, not the file list extraction
iself. I got stuck here because I was pretesting with display.
However, if instead of diplaying I use the list in a loop, it will
works perfectly:
. foreach i in `list2' {
2. di "`i'"
3. }
42.dta
43.dta
. erase 42.dta
. erase 43.dta
again thank you very much for the help.
On Tue, Jan 29, 2013 at 6:09 PM, daniel klein <klein.daniel.81@gmail.com> wrote:
> The example just sent does not actually work. This however has nothing
> to do with the file name beeing numeric ...
>
> Try instead
>
> cd c:/ado
> sysuse auto ,clear
> sa 42.dta
> di `"`: dir . file "*.dta'""'
> erase 42.dta
>
> Sorry for the inconvenience.
>
> Daniel
>
> --
> This works perfect for me
>
> cd c:/ado
> sysuse auto ,clear
> sa 42.dta
> di `": dir . file "*.dta""'
> erase 42.dta
> *
> * For searches and help try:
> * http://www.stata.com/help.cgi?search
> * http://www.stata.com/support/faqs/resources/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/faqs/resources/statalist-faq/
* http://www.ats.ucla.edu/stat/stata/