Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Help... File Handling....  RSS feed

 
Javeo Lineo
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi everyone,

Can anyone give me some idea regarding this matter, ah... I wanted to read a specific file like ("DirectoryName.txt") then will get some specific details in the files like a specific surnamename... can anyone brief me..

all I know is I will open the said file using FileReader then create a while loop to read all the details inside the file,

how do I get the specific datails that I want? Like getting the specific names inside the file :-(

Details:

the names are not organized in the file :-(, i will just get the specific surnames and their details... like for example: i need surnames like
Alley, Barbara and Chua...

in the ("Directory.txt") the fields are arranged in (surname, name, address)

ex:

Chua, Lyn - Los Angeles Cal. ....
........
........
........
Alley, Al - Los Angeles Cal. ...
........
Barbara, Armi - Houston, Tex. ...


first i will look for the surname "Alley" after searching it in the file ("Directory.txt")i will get the full details ("Alley, Al - Los Angeles Cal. ...") then search for another surname "Barbara"... and so on...

my friend told me to use a vector or ArrayList :-(, although im not yet familiar in those areas im studying it right now...


thank you for the time, and your assistance.... ;-)
 
santosh borse
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hay friend,


Use StringTokenizer class, i think it will work
(use seperator space and '\n')


Regards,
Santosh
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!