process each line in a file