Cutting strings from output of command

Hi,

I am new to scripting and need help in cutting strings from output of a command. For exapmle in am getting the following as the out out from the command i run:

Out Condition: Askajdsdfa | date: 1204 | oper: +

I need to get the output as Askajdsdfa and 1204.

Thanks

command_I_run | awk -F '|' '{print $1,$2 }' | sed 's/date://'

One way of many to do this.

cmd | awk -F '[|:]' '{print $1,$3 }'

--ahamed

Thanks all for your replies. :slight_smile: