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

st: reading file creation dates and names


From   Douglas Crawford <dcrawfo@itsa.ucsf.edu>
To   statalist@hsphsun2.harvard.edu
Subject   st: reading file creation dates and names
Date   Thu, 25 Mar 2004 13:32:47 -0800

Hi everyone,

I have approximately 250 text files that I would like to assemble into one large data file. The unique identifiers for the observations are contained in the file names and the file creation dates. This brings me to three questions:

1 - I would like to automatically create a variable = to the file creation date. I read through the various infile, infix, and insheet commands in the [R] (as well as the FAQ's), but couldn't find a solution.
2 - Is there a way of creating a foreach command that does not require explicit definition of the items. In other words can I say something like foreach file in folder {...
3 - If '2' is possible then I will also need to create a variable for each of the files = to the file name.

If these are possible, I am sure they have been discussed before, but I just couldn't access the information.

Thank you very much for your help.

Kindest regards,

Douglas



Douglas Crawford
Ph.D. Candidate, Dept. of Biochemistry UCSF

*
* 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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index