Created
August 7, 2015 08:06
-
-
Save Swarchal/f2d93b116710dbe5bfe4 to your computer and use it in GitHub Desktop.
load all csv files in the current directory
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
path <- paste(getwd(), "\\", sep = "") | |
files <- list.files(path=path, pattern="*.csv") | |
for(file in files) | |
{ | |
perpos <- which(strsplit(file, "")[[1]]==".") | |
assign( | |
gsub(" ","",substr(file, 1, perpos-1)), | |
read.csv(paste(path,file,sep=""))) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment