Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, is already up and running.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: Reading multiple .csvs from a folder

From   Matthew White <>
Subject   Re: st: Reading multiple .csvs from a folder
Date   Wed, 16 Nov 2011 15:12:33 -0500

Let's say the directory that contains the .csv files is stored in the
local `directory'. This will store all .csv files in `directory' in
the local `csvs':

local csvs : dir "`directory'" files "*.csv"

See -help extended_fcn- for more details. If you want to apply a regex
filter, I think you'll have to loop through the files in `csvs'


On Wed, Nov 16, 2011 at 3:03 PM, Vianney <> wrote:
> Hello collective wisdom,
> I was wondering if STATA has a means of reading all .csvs (or similar
> formats) from within a designated folder.
> Namely, instead of having to designate specific .csv *filenames*, I'd
> like to be able to designate a *folder* (and potentially apply a regex
> or regex-like filter for choosing specific .csvs from within said
> folder).
> I am essentially looking for the STATA equivalent of Python's GLOB [
> ;]
> Many thanks for your insights!
> Best regards,
> Vianney
> *
> *   For searches and help try:
> *
> *
> *

Matthew White
Data Coordinator
Innovations for Poverty Action
101 Whitney Avenue, New Haven, CT 06510 USA
+1 434-305-9861

*   For searches and help try:

© Copyright 1996–2015 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index