pull lines from a file based on the index