Reading input file char by char