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

RE: st: file management in Stata

From   "Nick Cox" <[email protected]>
To   <[email protected]>
Subject   RE: st: file management in Stata
Date   Thu, 31 Jan 2008 19:32:25 -0000

Thanks to Joseph for the publicity here. The name -fs- was chosen by
analogy with -ds-, now undocumented but still part of official Stata. It
is not ideal, but then a name like -files- would be a bad choice and
-dir- and -ls- are already taken. 

A more fundamental point is that if -fs- did not exist, it would not be
necessary to reinvent it. -fs- is in essence a wrapper for an extended
macro function documented at -help extended_fcn-, as inspection of the
code will make clear. But it may yet be convenient for purposes like

[email protected] 

Joseph Coveney replied to Gabi Huiber

Is there a way to save somewhere the file names found with Stata's dir

I have this problem where I need to fish out a list of weekly files
from a directory, and do things to them one by one. They are named
fileYYYYMMDD.txt but they don't necessarily come on the same day of
the week, and some weeks are skipped.

It would be good if I could produce a list of YYYYMMDD's and take it
from there, and I want Stata to just read the file names and remember
them -- whether as a macro or a list (I have no other name for a
vector with non-numeric elements).

Has anybody done this in Stata before?


Are you aware of Nick Cox's -fs-?  It would seem to do what you

-findit fs- turns it up, along with a lot of other things, so scan down
results, or type

-net describe fs, from( .

*   For searches and help try:

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