Ok, I guess I should have given more information. Let's say specifically, I wanted to run a script that will output the top 20 memory consuming processes as follows:
Rank PID Name Mem
1 2134 httpd 22MB
2 2135 httpd 21MB
3 3287 mysqld 18MB
4 6685 ddclient 7MB
...
Rank PID Name Mem
1 2134 httpd 22MB
2 2135 httpd 21MB
3 3287 mysqld 18MB
4 6685 ddclient 7MB
...