Hi
Before giving you an example, i bet you want to keep all outputs on 1 file right?
Can you issue the command:
Sh proc cpu | append flash:test.txt
If append doesn't work, i would suggest moving with a tcl script.
Thanks
Francesco
PS: Please don't forget to rate and select as validated answer if this answered your question