Hello, may I ask a silly question about read_csv()? Not sure what's wrong, it seems not differentiating the upper/lowercase in the file name. For instance, if my file name is "This_is_number#.csv", I used the following code to read different .csv file in a loop,
a <- 'This_is_number'
b <- c(1,2,3,4,5,6)
for (i in 1:length(b)){
filein <- paste0(a, b[i], '.csv')
datalist <- read_csv(filein)
.....
}
but read_csv() can load the file even if I mistakenly set a <- 'this_Is_Number', is there a way to make it read the exact file name? Thanks.
Hi @zhengchen,
Several operating systems have case-insensitive file systems, so this is not an R/RStudio/readr problem. You will find that you cannot write files with the same name that differ only in the case of the letters; one will be overwritten or you will get a "file already exists" message. The solution is to use another schema in the naming to distinguish sets of files. This may entail bulk renaming of files if they originate on a system with case-sensitive names.