Skip to content

Instantly share code, notes, and snippets.

@MarkEdmondson1234
Created August 10, 2015 08:04
Show Gist options
  • Select an option

  • Save MarkEdmondson1234/c119bfe81af5d5ab81c8 to your computer and use it in GitHub Desktop.

Select an option

Save MarkEdmondson1234/c119bfe81af5d5ab81c8 to your computer and use it in GitHub Desktop.
combine all csv files in a folder
## assuming you have a folder full of .csv's to merge
## csv's must all have identical column names.
folder <- "./path/to/csv/files"
filenames <- list.files(folder)
all_files <- Reduce(rbind, lapply(filenames, read.csv))
@RamomNF
Copy link
Copy Markdown

RamomNF commented Jul 30, 2019

I have a folder full of .csv's to merge, but they have different column names and may have different order of columns. Also, they sum up to 33.5gb so I can't load all of them in the memory. Do you know any way I can combine all the csv files in the folder?

@MarkEdmondson1234
Copy link
Copy Markdown
Author

MarkEdmondson1234 commented Jul 30, 2019 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment