sample
user id User Name
U456 Mathew
U457 Leon
U458 Cris
U459 Yancy
U460 Jane
and so on up to 500
Depends. If the two fields are separated using a TAB character, then fgetcsv($f,1000,"\t") would work to read in each line. Otherwise use substr() if it's a fixed width column text file to split up the fields (apply trim() eventually).
Loop over the rows and fields, and use your database interface of choice:
db("INSERT INTO tbl (user_id, user_name) VALUES (?,?)", $row);