Dear R-users, I have found on the list several posts addressing the issue of getting data for a list of defined files. However, I found nothing about scanning a given folder and retrieving the list of, let's say, .txt files (I probably used the wrong keywords). Could someone tell me which posts or function help I should look at? Thanks in advance Sebastien
Sebastien, see ?list.files, especially the 'pattern' argument. For your particular case it is list.files(pattern="\\.txt$") You might want to use the 'ignore.case' argument as well. Gabor On Mon, Dec 8, 2008 at 10:53 PM, <pomchip at free.fr> wrote:> > > Dear R-users, > > I have found on the list several posts addressing the issue of getting data for > a list of defined files. However, I found nothing about scanning a given folder > and retrieving the list of, let's say, .txt files (I probably used the wrong > keywords). Could someone tell me which posts or function help I should look at? > > Thanks in advance > > Sebastien > > ______________________________________________ > R-help at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. >-- Gabor Csardi <Gabor.Csardi at unil.ch> UNIL DGM
?files and the links therein. Seems like a most obvious keyword to me for asking about files ... Cheers, Bert Gunter -----Original Message----- From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org] On Behalf Of pomchip at free.fr Sent: Monday, December 08, 2008 1:54 PM To: r-help at r-project.org Subject: [R] Scan a folder for a given type of files Dear R-users, I have found on the list several posts addressing the issue of getting data for a list of defined files. However, I found nothing about scanning a given folder and retrieving the list of, let's say, .txt files (I probably used the wrong keywords). Could someone tell me which posts or function help I should look at? Thanks in advance Sebastien ______________________________________________ R-help at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.