started writing getItem, has problems

i spent a few hours trying to figure out why this doesn't work. It goes
through the input file line by line, looking for the empty line. If it
does, it stops the while loop at that line, and if not keeps going till
the end of file. Once it exits the loop it should add the new item in,
but it doesn't. HELP??