changed patterns in read_file_in() to handle factor file