replacing in infiles instead of outfiles