I am trying to import a whole bunch of csv files into a postgreSQL database. CSV files are format is shown below. I want to be able to swap between html files and display different statistics (tables) for each county.
County,Number,Statistic,Year,Source,
Atlantic;403;Assualt;2010;https://www.njsp.org/ucr/uniform-crime-reports.shtml
Bergen;529;
Burlington;267;
Camden;859;
Cape May;160;
Cumberland;300;
Essex;1275;
Glouchester;209;
Hudson;838;
Hunterdon;38;
Mercer;416;
Middlesex;519;
Monmouth;442;
Morris;202;
Ocean;322;
Passaic;852;
Salem;67;
Somerset;73;
Sussex;53;
Union;421;
Warren;453;
There a bunch of csv files where the statistic I'm tracking is different i.e. assault, theft, etc. Is there a way to import all of these csv files and create a table while doing that? Or would it be better to create a table inside the schema.rb file and then run some sort of script inside the seeds.rb file?