factor out the routine to split list into an index of filenames