I am reading the same pipe-delimited file using NetBeans (to test the basic code) and Android Studio (actual application) and getting different results.
Looks like the problem is in using hasNext() in the header of for loop and using nextLine() in the body of for loop. When I replaced hasNext() with hasNextLine(), my record counts matched. Don't understand why, since hasNext() is supposed to look at something, not change, but it worked.