c/c++ or java...
for c/c++ i have snippet that might help you:
FILE *f = fopen(file, "rb");
if(f == NULL) {
return DBDEMON_OPEN_ERROR; // open fail
}
for(int i = 0; feof(f) == 0; i++)
{
fscanf(f,"%d %s %s %c\n", &db[i].id, &db[i].name[0], &db[i].uid[0], &db[i].priviledge);
db_size++;
}
fclose(f);
this is reading a file with the following format:
int string string char
1 SOMETHING ANYTHING Z
to a struct define as follows:
typedef struct {
unsigned int id;
char name[DBDEMON_NAME_MAXSIZE];
char uid[DBDEMON_UID_MAXSIZE];
char priviledge;
} DATABASE;
Use fscanf with care, since no types are checked, etc, it can result in errors.
But I think this is pretty efficient.