Determining User Consumption in solaris

Inorder to find the user memory consumption I used the command: prstat -s cpu -a -n 10
But now I want to automate it and want to write the output to a file.
How can I write the out put of user name and percentage of consumption alone to an output file.?

Maybe something like this?

prstat -c -s cpu -a -n 1 1 1 | grep -v Total | tail +4 | awk '{print $2, $5}' > /tmp/myfile

Plug that into something like ScriptRunner and it can alarm when somebody uses too much, graph usage over time etc... should take about 10 minutes to set up...

Cool Man:)
This is exactly what I required!!
Thanks a lot!!