Create function to generate arrays from csv files