generic file reader
first input