Patternmatching lines in file, and only rebuild and save the matching lines to output.