Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # -------------------------------------------
- # Beispiel 1
- # -------------------------------------------
- #HierSindWirLULULU
- setwd(getwd()) #:^
- # get the name of the zipped file
- fname_zipped = "gtfs.zip"
- # list all files names inside of a .zip file
- fnames = as.character(unzip(fname_zipped, list = TRUE)$Name)
- # read every file into R, assuming they are .csv files
- lst = vector("list", length(fnames))
- for (i in seq_along(fnames)) {
- lst[[i]] = read.csv(unz(fname_zipped, fnames[i]), stringsAsFactors = F)
- }
- #remove .txt cause kippodippobippo
- nameKame <- gsub(".txt", "CSV", fnames)
- for(i in 1:length(lst)) {
- assign(paste0(nameKame[i]), lst[[i]])
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement