Sorting CSV file in Vim

Suppose you have some sleep data from Sleep As Android.

Tz,From,To,Sched,Hours,Rating,Comment,Framerate,Snore,Noise,Cycles,DeepSleep
"Europe/Warsaw","09. 01. 2015 22:28","10. 01. 2015 5:25","10. 01. 2015 5:30","6.950","0.0","","10000","252","0.0","5"
"Europe/Warsaw","11. 01. 2015 22:21","12. 01. 2015 5:21","12. 01. 2015 5:20","7.000","0.0","","10000","0","0.17903233","6"
"Europe/Warsaw","12. 01. 2015 21:24","13. 01. 2015 4:25","13. 01. 2015 4:20","7.030","0.0","","10000","0","0.10940012","6"
"Europe/Warsaw","13. 01. 2015 21:31","14. 01. 2015 4:27","14. 01. 2015 4:20","6.930","0.0","","10000","0","0.10940012","5"

You’re curious how many deep sleep cycles you have. Let’s sort the list. First, select rows. Then type this. Columns have been trimmed for the sake of readability.

'<,'>!sort -t',' -k6 -n -r

Before:

"0.0","","10000","0","0.10940012","5"
"0.0","","10000","0","0.17903233","6"
"0.0","","10000","0","0.10940012","6"
"0.0","","10000","0","0.103614815","4"

After:

"0.0","","10000","0","0.17903233","6"
"0.0","","10000","0","0.10940012","6"
"0.0","","10000","0","0.10940012","5"
"0.0","","10000","0","0.103614815","4"

That’s it!
This protip has been written in 1101 seconds