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]
st: capturing directories and file names that start with numebrs, ex: "1111.zip" (problem with dir extended_macro_function)
From
Lucas Ferreira Mation <[email protected]>
To
statalist <[email protected]>
Subject
st: capturing directories and file names that start with numebrs, ex: "1111.zip" (problem with dir extended_macro_function)
Date
Tue, 29 Jan 2013 17:17:42 -0200
Dear statalisters,
I need to import tousands of files that are in a folder. I know I
should to first extract a list with the file names.
The normal way to do that would be:
cd "directory name"
local allfiles : dir . files "*"
This works with alfabetic file-names. The problem is that file names
are numeric. For example:
"10001.zip"
"10002.zip"
"10003.zip"
the extended macro function "dir" does not seem to cope with numeric filenames.
( I also tryed with .dta files (like 111.dta, 222.dta) and it does not work.
Is there a way to circunvet this and get the correct list of file names?
regards
Lucas Mation
IPEA
*
* 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/