I have a large number of files, each with a name format of "ARU1_20100706_6_164443000.csv". The part which I am interested in is the frequency identifier "164443000". Some of the files in this folder have the same frequency identifier; for each identifier, I would like to create a new folder and place all files with this identifier in this folder together.
So far I had this:
csvfiles <- list.files("C:\\Users\\name\\Documents\\CSV Files\\ARU1", pattern="*.csv", full.names=FALSE)
csv <- data.frame(csvfiles)
for (i in 1:length(csv)) {
csv$freq <- str_sub(csvfiles, start = 18, end = 25)
}
I am a complete R newbie and am struggling so thanks in advance for the help.