select lines automatically, replace string in selected lines