Created
April 29, 2025 19:18
-
-
Save mhweber/93a45368f432e1e91d52cd0a505cc10d to your computer and use it in GitHub Desktop.
Read and combine all files in a directory and write back
This file contains hidden or 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
# in this example I'm looking for files with the name patter 'filename' that happen to be .zip files | |
mydir <- "my/dir/space" | |
pattern <- "filename" | |
FileList <- list.files(path = mydir, pattern = pattern, full.names = TRUE) | |
result <- purrr::map(FileList,~read_csv(.)) | |
result <- bind_rows(result) | |
write_parquet(result,'mydir/myfile.parquet') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment