I have a CSV file filename.csv
with the contents.
,"Range 1 (%)","Range 2 (%)"
"Color","Number Color 1","Number Color 2"
"Red","99.0","5.2"
"Orange","12.9","0.0"
"Yellow","33.9","1.2"
"Green","13.9","76.2"
"Blue","87.6","97.2"
"Purple","86.8","55.5"
I am trying to sort the file numerically by values from the second column. However, the first two rows of the file are the titles, and I would like to omit them. My command is below, but it outputs the original file without the first two rows, but also without sorting by the second column.
awk -F ',' '(NR>2)’ filename.csv | sort -t',' -k2 -n
Any help is appreciated :) Thanks!