Filter and transform lines of text