[R] Reading highest numbered file

Erik Iverson eriki at ccbr.umn.edu
Tue Sep 14 20:45:51 CEST 2010


See ?list.files and ?file.info.

E.g.,

file.info(list.files("~/tmp", full.names = TRUE))

Michael D wrote:
> I have a bunch of files named
> "[identifier1].[identifier2].[yyyymmdd].[hhmmss].txt" and im having
> trouble updating my read script for the timestamp.
> 
> I've been using file.exists and a for loop but its highly inefficient
> and cumbersome.
> 
> Would there be someway to create an object containing the string of
> each .txt file in some directory and to sort them by the date and time
> stamps so I can easily pull the last few days worth of files into a
> workspace?
> 
> 
> Thanks.
> Michael
> 
> ______________________________________________
> 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.



More information about the R-help mailing list