in reply to Assigning scalar to each field in a flat file database

I then want to insert each variable into a mysql table .....

No need to assign these values to variables, just dump them into a mysql table like such....
LOAD DATA INFILE 'file_name.txt' INTO TABLE tbl_name FIELDS TERMINATED BY '|' LINES TERMINATED BY '\n'

Just be sure that your table has been created and all your columns exist, etc, etc ....
-Silent11