Top utility in bash for loop

view story

http://www.unix.com – Dear All, is it possible to use top utility in for loop? I am trying to get top swap space consuming processes in my for loop. I got multiple way (using /proc FS) however have anybody used top command in for loop? Using /proc FS giving solutionbut itrs more complex. Please suggest if anybody has simpler solution (HowTos)