created method to process csv files and extract records/headings