perl -ne'print { s/.../.../ ? STDOUT : STDERR } $_' out.err >out.csv