Results 1 to 2 of 2
- 11-21-2012, 09:47 PM #1
Member
- Join Date
- Sep 2012
- Posts
- 4
- Rep Power
- 0
reading in file and storing in array
I have to read in a file like this:
meaning
something that one wishes to convey, especially by language
term
a word whose definition is in a glossary
word
a string of characters in a language, which has at least one character
definition
a sequence of words that gives meaning to a term
glossary
a list of difficult or specialized terms, with their definitions,
usually near the end of a book
language
a set of strings of characters, each of which has meaning
book
a printed or written literary work
I need to store the terms and definitions in separate arrays. However in the same order respectively so they still align. Is there a good way to do this?
- 11-22-2012, 12:16 AM #2
Re: reading in file and storing in array
Well the best way would be to create objects and store them in a Collection but I guess that is beyond your learning at this stage. What you need to do is read a line of text, store in term array, read a line of text, store in definitions array, repeat until reach end of file. If there are actually blank lines then you will need to handle them as well.
Similar Threads
-
Trouble writing an Integer to a text file and reading back with scanner and storing
By Louis345 in forum New To JavaReplies: 1Last Post: 11-11-2012, 01:55 AM -
read a data file and storing it in an array
By jwl in forum New To JavaReplies: 3Last Post: 10-27-2012, 12:44 AM -
Reading input and storing into array
By joeyalf in forum New To JavaReplies: 1Last Post: 12-04-2011, 08:08 PM -
Storing all file names and paths in a directory into an array
By lief480 in forum Advanced JavaReplies: 3Last Post: 11-11-2010, 10:22 AM -
Reading a txt file and then storing it in a 2d array
By blkshp1990 in forum New To JavaReplies: 2Last Post: 11-05-2009, 12:31 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks