A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Java in General
Reading Text file data into an array
Joined: Jun 22, 2009
Oct 10, 2009 10:41:59
I would like to know if I can read the text file data into an array. Each word in my text file should be stored into array.
Thank you in advance..
Joined: Oct 13, 2005
Oct 10, 2009 11:27:45
You would have to count the lines first, then you know what size of array to use. Then reading into the array is quite easy.
Might be better to read into a List<
> then convert the List to an array, because that saves you the counting.
I agree. Here's the link:
subject: Reading Text file data into an array
Can we write in a file from an array???
File into object stream
read string from textfile into array
Can we write in a file from an array?
JDBC for loading data into SQL Server
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2014