yep.
I've not stepped through lines of text in a text file, but I'm sure its possible, you'd just have to do more research... :-)
you have the basic idea if you put the addresses in the DB (while statement, etc...)
it sounds like you don't really need code (you sound like you have the hang of it).
if the bounced emails were in the DB:
basic outline:
perform query to get all the user ID's of the bounced emails (alternatively, you could get the bounced emails addresses themselves - ID's are better)
using a while loop, go through each address and perform an UPDATE query that sets the value of the email address to NULL.
(i.e. "UPDATE address_table SET email=NULL WHERE email=$email_from _list")
print "this address deleted: address" or something to confirm to the screen.
Others may have an idea how to step through a text file, or you could look up what to do at php.net -> you basically want to read the file in to an array, then step through the array in a similar fashion as you would with a mysql result object.