The input file has this data:
1 // Comments 0
0
14 // Comment 1
4 // Comment 12
32
21 // Comment 13
I need to just take those first integers, such as 1, 0, 14, etc. and put them into their own integer array. I have attempted to use Scanner
, but using the regex split("\\s")
does not seem to do what I need.
My idea is to bring it all into a String arraylist
, which I have done, but at that point I can't figure out how to then strip out just those integers. A big part of the problem is that each comment also has integers in it, so if I just get out ALL of the integers on each line, those are also included...which I don't want.
If anyone could help walk me through the logic I need to process this file, I would appreciate it. Thanks.