<?php foreach(file('input.txt') as $k) if(preg_match('%([^\s]+)[\s]+([^\s]+)[\s]+(.+)%',trim($k),$m)) echo $m[1].':'.$m[2].'@'.$m[3]."\n"; ?>