Awk to sort by line length:

$ wc -l /usr/share/dict/words
483523 /usr/share/dict/words
$ awk '{ print length(), $0 | "sort -n" }'  /usr/share/dict/words

Remove blank lines and print the 7th field

awk 'NF > 1 {print $7}' input

Quick Combo Demonstration:

# cat /tmp/freemem.drmets
             total       used       free     shared    buffers     cached
Mem:           125          9        115          0          0          6
-/+ buffers/cache:          2        123
Swap:            7          0          7
# cat /tmp/freemem.drmets | grep Mem | awk '{ freemem=($4+$7);qouta=$2*.75 ; if ( freemem >= qouta ) test="good"; else test="bad"; print freemem,qouta,test;}'
121 93.75 good