List numbers in decreasing order

Hello,
I need to realize, in a root macro or a c++ program, a line of commands
to read a list of numbers from a file and write them in a new file in decreasing order.
How can I do?
Thank you very much!
Elena

Hi Elena,

What aboutcat input.dat | sort --numeric-sort --reverse > output.dat

Cheers,
Philippe.