read input from a file