Anyone know Java? I need some help!

<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>You have to learn how Java treats files.</p>

<p>My teacher has some files and streams slides here:
[Gar-Field</a> High School - +IB CmptrSci (SL): 01 Files](<a href=“http://ib-cmptrsci-sl-01-d.gar.groupfusion.net/modules/locker/files/group_files.phtml?gid=1965755&parent=4776399&sessionid=04bd05fc65a034fcfc7b2dc521dadb3b]Gar-Field”>http://ib-cmptrsci-sl-01-d.gar.groupfusion.net/modules/locker/files/group_files.phtml?gid=1965755&parent=4776399&sessionid=04bd05fc65a034fcfc7b2dc521dadb3b)</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>

<p>Split. ArrayList.</p>

<p>^ what they said.</p>