Read and parse data from input file