Between lines with marks a and b (inclusive), append each line starting with "Error" to a file:
:'a,'b g/^Error/ .w >> errors.txt
After selecting lines in visual mode you can use this.
After visually selecting text, press :,
'<,'> g/The/ .w>>newfile.txt