I can read the file a line at a time, but when I try to parse it, it generates the NoSuchElementException. The elements in the file is separated by spaces. What could this problem be. How do I rectify it? I have been working on it for a very long time.