Ho w to read file with date stamp in R

Hi All,

Need help to import excel file with date stamp from local drive into R dynamically.

for example my file is support data 31032019.xlsx and want read sysdate()-1 file like support data 30032019.xlsx.

kindly help if any one has idea.

I'm not sure if I understand you correctly, do you want to read a file from the previous day like in this example?

filename <- paste0(format(Sys.Date() - 1, "%d%m%Y"), ".xlsx")
filename
#> [1] "30032019.xlsx"
openxlsx::read.xlsx(filename)

Created on 2019-03-31 by the reprex package (v0.2.1.9000)

1 Like

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.