Thank you, that was it.
Best,
Milu
On Wed, Jan 20, 2021 at 1:33 PM Eric Berger wrote:
> for ( file in filelist )
>
>
>
> On Wed, Jan 20, 2021 at 2:21 PM Miluji Sb wrote:
>
>> Thank you for your reply and the solution. Yes, I would like the date to
>> be
>> the column header for all the files
for ( file in filelist )
On Wed, Jan 20, 2021 at 2:21 PM Miluji Sb wrote:
> Thank you for your reply and the solution. Yes, I would like the date to be
> the column header for all the files in the list.
>
> This is what tried following your suggestion;
>
> filelist = list.files(pattern = ".*.t
Thank you for your reply and the solution. Yes, I would like the date to be
the column header for all the files in the list.
This is what tried following your suggestion;
filelist = list.files(pattern = ".*.txt")
date <- 2101
for (file %in% filelist){
datalist <- read.table(file)
write.t
a) I recommend _not_ overwriting the input files. Very difficult to
debug/recover if anything goes wrong.
b) I recommend making a function that takes the file name, source directory,
and destination directory, and reads the file, makes the change, and writes it
to the output directory.
c) Your
Dear all,
I have more than 200 text files in a folder without header - example below.
I would like to read, add a common date header to all the files, and write
(replace) the files.
## Read files
filelist = list.files(pattern = ".*.txt")
datalist = lapply(filelist, function(x)read.table(x, header
5 matches
Mail list logo