sorting files

hi

i have file like below:

col1,col2,col3,col4
val1,val2,val3,val4
abc1,abc2,abc3,abc4

this is a 4 column file with 3 rows.

i want to sort the file like.. first on col1, then on col2 and so ..on..
i want the sort order to be descending.

Pls help..

Thnks
Sumit

FWIW -

sort -o newfile olfdfile

does what you ask by default. However you seem to think you need to specify fields.

sort -t ',' -k1.1,1.4 -k2.1,2.4 -k3.1,3.4 -k4.1,4.4 -onewfile oldfile

-k fromfield,tofield - usually same field, but you can but together field 2+3 using -k 2,3.
If you give only -k 1 the key is from field 1 to end of line.
This enough, dynamic field length:
sort -t ',' -k 1,1 -k 2,2 ... infile > outfile
if field value is number, you can use -k 1,1n to use numbering sort
also option r is usable for reverse order. Read man sort to get more info.