in reply to Remove newlines and join lines

just read the file to an array, then loop on the array. while the line don't match your names, push it to a new array, when the line matches your name push it too to the new array and skip the empty line.

Hotshot