<p>I need to assign the first column of a notepad file to an array, and print that array onto the screen. For example:</p>
<p>Let’s say “hello.txt” contains this data:</p>
<p>5 one 2
6 two 3
9 three 5
7 four 7
2 nine 0</p>
<p>I want to make an array that will contain the numbers in the first column of “hello.txt.” So basically and array will be {5, 6, 9, 7, 2}. But, I can’t just create it regularly because the text file has 100’s of numbers in the first column.</p>
<p>Any suggestions? Thanks.</p>
<p>I still have no idea. I understand how to read the entire text file, but just singling out the first column (or second, or third) is what’s giving me difficulties.</p>
<p>I got it. Read the rows, and have as many arrays as you have rows you need to read. And then make a new array, with the elements being the first elements in those previous arrays.</p>
<p>Have as many arrays as rows I need to read? That would be hundreds of arrays!</p>
<p>reason why we have loops… and garbage collection.</p>
<p>Or there’s the use of an ArrayList.</p>