I need to generate many csv files a day and story in a folder with the process time in the file name.
I tried to append the system time to the file name but was not able to do it using paste0
write.csv(output, paste0("C://Users/My Computer/dir", Sys.time(), ".csv"))
Is there a way to include system time in the file or is the user of these files better of finding a function to read these files by modification date ?
A work around is to format the system time differently. I got around this by replacing the ":" character with "."
write.csv(output, paste0("C://Users/My Computer/dir", format(Sys.time(), "%d-%b-%Y %H.%M"), ".csv"))
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With