Results 1 to 3 of 3
Thread: Reading from file
- 11-29-2011, 12:19 PM #1
Member
- Join Date
- Nov 2011
- Posts
- 1
- Rep Power
- 0
Reading from file
Hi,
I am new to java and wish to implement a program, that will read numbers from a text file, put them into an array so that I can then perform an Insertion sort on them.
I have managed to get an insertion sort working so far, with a fixed array, but can not do it reading an array from file,
any help would be appreciated.
Thanks
Gower
- 11-29-2011, 12:56 PM #2
Senior Member
- Join Date
- Aug 2011
- Posts
- 248
- Rep Power
- 2
Re: Reading from file
We can't help you without seeing your code.
- 11-29-2011, 02:20 PM #3
Re: Reading from file
Your sort code should work the same no matter where you get the data to be sorted from.
What code are you using to read the data with?
The Scanner class has some easy to use methods.
Or do a Search on the Forum for readLine() to get sample code for using the BufferedReader class.
Similar Threads
-
Reading file external to jar file
By nn12 in forum New To JavaReplies: 6Last Post: 02-04-2011, 05:46 AM -
reading a file and writing to a file....help!!!!
By java_prgr in forum New To JavaReplies: 3Last Post: 07-26-2010, 06:53 PM -
Reading and Writing the contents of a file to another file
By priyankatxs in forum New To JavaReplies: 9Last Post: 10-20-2009, 10:52 AM -
[SOLVED] how to reading binary file and writing txt file
By tOpach in forum New To JavaReplies: 3Last Post: 05-09-2009, 11:31 PM -
Help for reading a doc file
By thehero in forum New To JavaReplies: 1Last Post: 02-24-2009, 06:44 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks