Reading and combining multiple CSV files

Hi,

I am using Observable Plot to create various plots of some data stored in CSV files. Normally I have several CSV files within one folder. These files have the same structure (number of variables and variable types). Is there any way to simultaneously read and combine these CSV files into one, so I can use them in Plot?

Currently I use R/Python to read/combine the data into one single CSV, and then I upload win Observable. I would like to have some JS-based solution… I had a look at the arquero library but I can’t find a solution.

Thanks a lot!

Do you plan to use FileAttachments, or do you want to load them from an API with, say, d3.csv? Once each dataset is loaded, making a combined dataset could be as simple as concatenating:

data = […date1, …data2, …data3]

I guess both solutions would work.

I managed to find a solution for this, although I am not sure it is the best one. Seems to work.

1 Like