Your program and/or the runcobol command most likely has commands to skip lines, position the cursor, set background and foreground colors for the output, etc as evidenced by the blank lines before the output and the red text. Your terminal emulator (the program you use to connect to the host) interprets these commands and you see the results (red text). When output is captured by Visualcron, it does not interpret, but captures and displays the codes. Ideally you would want to take care of that on the source side by editing the program or maybe write a wrapper shell script (looks like you are in a *NIX environment) that calls the runcobol command line and strips the control characters before outputting them. That is beyond this forum though.
All that said, you need to strip off the ANSI VT100 control characters. To do this, you need to know the format of those control codes. They are typically Esc-bracket, followed by an optional 2 digits, optional semi-colon, optional single digit then either an m or an H in this example, then an optional HEX 0F (paste the output into a good text editor that will let you convert the text to HEX to really see what characters you are dealing with). No problem, you just need to match all of that and replace with nothing! Also include that string at the start, open paren, B, ESC, close paren, 0. When all that is done you will be left with some blank lines so wrap that in another call to remove lines consisting of just carriage return/linefeeds. Being able to describe what you need to match is the start, converting that description to a regular expression is the next (fun) part.
Note this is somewhat specific to your example, you may encounter other codes that will require some tweaking of this regex. Make sure to document this carefully for future maintainers!
{REGEX(,Replace,{REGEX(,Replace,{TASK(PrevTask|StdOut)},(\(B\x1B\)0|\x1B\[(\d?\d?;?\d?(m|H)(\x0F)?)),)},\r\n,)}
Break down the regular expression:
( - Start a group
\(B\x1b\)0 - A string matching a literal open paren followed by a HEX1B (an ESC) then a close paren then a 0
| - OR a string matching...
\x1b\[ - ESC then literal left bracket
( - Start another group
\d?\d?;?\d? - followed by an optional digit, followed by another optional digit (vc doesn't allow the regex form of {,2} to indicate 0, 1 or 2 digits), optional semi-colon, then another optional digit
(m|H) - Followed by a small m OR a capital H
(\x0f)?)) - Followed by an optional HEX 0F and close the second and first groups
Either of those groups get replaced with NULL, then blank lines are removed leaving you with: Test2