I am trying to learn bash/shell *nix commands /scripting.
So rather than writing a python program, I thought of trying it out using bash/awk etc but am having a hard time.
I have a huge text (its actually csv )file
id_1, id_2, some attributes.
I want to sort this file based on id2?
how do i do this?
Thanks
Use the
--keyoption forsort.For example, the following sorts
input.csvon the second field (using comma as a field separator) and writes the output tooutput.csv.p.s. Don’t forget to use the
-noption if you’re doing a numerical sort.For more info, see the man page for sort.