Here's some commented C code that would show how I would implement it.

Code:

FILE *file = fopen(pathName, "r");
char buffer[BUFSIZ];
int currentChar;
//the magical struct that holds whatever you are reading in
MagicalStruct *object = newMagicalStruct();
//type of object that's currently used; the types are defined somewhere
//else in the file
int type = NO_TYPE;
//loop until the file (will explicitly break out at end)
while (!feof(file))
{
//get the current char to check for comments
currentChar = getc(file);
//see comment, so skip the rest of the line
if (currentChar == '#')
fgets(buffer, BUFSIZ, file);
//put the character back into the stream
putc(currentChar, file);

//get the current option
fscanf(file, "%s", buffer);
//end of the input
if (!strcmp(buffer, "end")
break;

It's basically like a lightweight XML, and I wrote a simple sax parser for it in a matter of hours in C++. Then I wrote a DOM builder which builds off the SAX parser in a few more hours after that. The whole thing took maybe a weekend to design develop and debug in total. The filetype is *super* robust, and I've been using it for three years now, in many *very* different projects.

Plus, since I can build a DOM representation dynamically, I can write properly formatted files too, not just read them.

While a simple position-denotes-meaning filetype is sufficient for a one-off parser, I'd recommend taking a few days to design something you can use in the future.

and I have a hard enough time getting the devs to make a Jaguar version... they decided to distribute like ten libraries in the actual source but the only one they don't, isn't on Jaguar...
and then their amazed when I install a library that even OSC said I couldn't install (IRC channal ) and get the game to run.
(and then I have like twenty ppl asking me how to do it)

anyway enough of my ranting...
I'm gonna do it this way.

tokenize by \n
tokenize each tokenized line by " "
loop through each filled line (line that has more than "\n")
find if line has an object name.
pass that object name and the offset to that object handler.
wait for object handler to get to end and give us back offset of "end"