• The first time you call getArrayFromCSV it reads lines until it gets to the end of the file. The second time around it's already at the end of the file, so there are no more lines to read.

    You can fix this either by reopening the file before each call, or by refactoring your function to pull out all the data you need in one pass.

About