Handling multiple column data with Java

Posted by Ender on Stack Overflow See other posts from Stack Overflow or by Ender
Published on 2010-04-16T00:13:05Z Indexed on 2010/04/16 0:23 UTC
Read the original article Hit count: 725

Filed under:
|

I am writing an application that reads in a large number of basic user details in the following format; once read in it then allows the user to search for a user's details using their email:

NAME             ROLE          EMAIL
---------------------------------------------------
Joe Bloggs       Manager       [email protected]
John Smith       Consultant    [email protected]
Alan Wright      Tester        [email protected]
...

The problem I am suffering is that I need to store a large number of details of all people that have worked at the company. The file containing these details will be written on a yearly basis simply for reporting purposes, but the program will need to be able to access these details quickly.

The way I aim to access these files is to have a program that asks the user for the name of the unique email of the member of staff and for the program to then return the name and the role from that line of the file. I've played around with text files, but am struggling with how I would handle multiple columns of data when it comes to searching this large file.

What is the best format to store such data in? A text file? XML? The size doesn't bother me, but I'd like to be able to search it as quickly as possible. The file will need to contain a lot of entries, probably over the 10K mark over time.

© Stack Overflow or respective owner

Related posts about java

Related posts about data-handling