
-----------------------------------
IntelMaster
Tue May 25, 2010 5:50 pm

Creating an array with a text document
-----------------------------------
Hi, 

I want to take the numbers from a text document and make an array out of it, but for some reason my program is not working. After gathering the arrays I want to calculate the median for the numbers. Here is my program so far: 

		String amounta=jTextField8.getText();
		int amount=Integer.parseInt(amounta);
		int sum=0;
		try {
			FileInputStream in = new FileInputStream("numbers.txt");
			BufferedReader br = new BufferedReader(new InputStreamReader(in));
			
			int numbers

-----------------------------------
Insectoid
Tue May 25, 2010 6:04 pm

RE:Creating an array with a text document
-----------------------------------
Make sure your file is really 'numbers.txt' and not 'numbers.txt.txt'. Happens a lot (to me). Damn you Windows, I'll type my own extensions! 

Other than that, I can't think of what's wrong (due in no small part to my inability to read Java without my head exploding).

-----------------------------------
DemonWasp
Tue May 25, 2010 6:49 pm

RE:Creating an array with a text document
-----------------------------------
@Insectoid: you can force Windows Explorer to always show extensions. This is one of the first things I do whenever I set up Windows, because foobar.bmp.jpeg has always been a stupid, irritating problem.
