Ohmygod...
doesn't anybody read manuals anymore :-)
Don't you think this sounds like a problem that a gazillion people have had before and that the database people would have found a solution to years ago? :-)
Like said in the database talk;
The data is already in a format that is acceptable to mysql, you only have to tell mysql what the format is.
use this sql statement:
load data infile 'filename.txt'
into table your_table
fields terminated by "\n"
lines terminated by "\n\n";
the "\n\n" is the empty line between records.