read input file and construct fileheader