[Solved] How to read portions of text from a .txt file in Java?
You can use Scanner class, which provides a Scanner#nextInt() method to read the next token as int. Now, since your integers are comma(,) separated, you need to set comma(,) as delimiter in your Scanner, which uses whitespace character as default delimiter. You need to use Scanner#useDelimiter(String) method for that. You can use the following code: … Read more