s-news
[Top] [All Lists]

read a file with name the current date automatically

To: s-news@wubios.wustl.edu
Subject: read a file with name the current date automatically
From: Spyros Vrontos <svrontos@aueb.gr>
Date: Thu, 22 Feb 2001 23:07:15 +0200
Hi all.

I would like every working  day to import a file using read.table.
The file will be in D:\\DATA\\2001\\
and it will be named as the paste of "dat", of the current date 
(yymmdd) and the ".txt" extension. The name of the object will
be the paste of "dat" and the current date.

for example:
current <- "dat010222.txt"
filename <- paste("D:\\DATA\\2001\\", current, sep="")
dat010222 <-  read.table(filename,header = TRUE, sep = c(1, 11, 21, 31 ,
41),skip=1)

Is there a way for this to be done automatically for each new day,
using a function like date()?

Any suggestion is highly appreciated.

Thanks.
Spyros.
 


<Prev in Thread] Current Thread [Next in Thread>