in reply to Remove string from file

I'll suppose the key is the first word on the line,

$ perl -pi -e's/^TOM\b.*\n//' userlist.txt $
The regex can be adjusted for other circumstances.

After Compline,
Zaxo