[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

RE: st: ordered directory

From   "Feiveson, Alan H. (JSC-SK311)" <>
To   <>
Subject   RE: st: ordered directory
Date   Wed, 26 Sep 2007 09:27:20 -0500

Nick, Austin - Thanks - I had forgotton about the "redirect" (>)


-----Original Message-----
[] On Behalf Of n j cox
Sent: Wednesday, September 26, 2007 9:09 AM
Subject: Re: st: ordered directory

One way of tackling this is by writing a wrapper command, say

program oscmd
	version 8.2
	tempfile foo
	!`0' > `foo'
	type `foo'

When you then type

. oscmd dir *.dta /od

Stata opens a temporary file, then opens up a shell in which your
arguments are executed and the results sent to a temporary file.
Stata finally types the file. More elaborate variants could be written
to process the file.

See also


Al Feiveson
Is it possible to obtain an ordered directory of files from within
Stata? For example in Windows using a command prompt, one can type

    dir *.dta /o:d

to get a listing of files in order of modification date.

Apparently the -dir- comand in Stata does not take any sort options.

Also, typing

    !dir *.dta /o:d

is useless because the output immediately disappears from the screen.

*   For searches and help try:

*   For searches and help try:

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