Dear All,

 

Could you please recommend how I can do this?

 

I have several text files in one folder. Let's name them A0801.RSK,
A0802.RSK, ....

I would like R to 

1)      Know all file names in this folder

2)      Update value in one column of these files

3)      Write results in another text file with _xval in the file names

 

Below is R code for read, update, and write one file

 

Import<-"C:/A0810.RSK"

Table<-read.table(file= Import, sep = ",", head=TRUE, na.strings = "NA")

Table$VALUE <-0

Export<-"C:/A_XVal0810.RSK"

write.table(Table, file= Export, sep = ",", col.names = TRUE)

 

Thank you

Best Regards, 

Suphajak Ngamlak
Equity and Derivatives Trading
Phatra Securities Public Company Limited
Tel: +662-305-9179  
Email: supha...@phatrasecurities.com 


        [[alternative HTML version deleted]]

______________________________________________
R-help@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.

Reply via email to