You need to read and work with a directory of similarly structured CSVs.
Solution
Treat the directory of CSV files as single database table.
Discussion
This is one of DuckDB’s superpowers. The developers seem to know what we data folk have to put up with on a daily basis and have made wonderful affordances for many common idioms.
We’ll use some climate data from a 538 project for a quick example. It has ten CSV files, one for each of the stations they chose to include in the study. We’ll read them all in and also keep the filename around since the station id does not seem to be in the schema (please be kind to your future self and others and include this info in the data file).