Fixed issue with manually added data in read file

Length read as length + 1 so, length - 1 is used in while.
Note: when changing to non-manually added data in input file, change back.