Sort by

recency

|

72 Discussions

|

  • + 0 comments

    Why sort -s -t$'\t' -k 2ndoes NOT work butsort -s -n -t $'\t' -k 2 does?

  • + 0 comments

    To work this problem on a local system, you must ensure your input file contains tabs between fields. I pasted the text from a browser and then replaced repeated spaces with tabs using this:

    sed -i -E 's/\s{2,}/\t/g' /tmp/pasted-data.tsv
    

    A nice way to confirm that you succeeded, display the columns of text by tab delimiter and expect it to look like a pretty table:

    column -ts$'\t' /tmp/pasted-data.tsv
    
  • + 0 comments

    can be managed like:

    sort -rnk2 -t $'\t'
    
  • + 0 comments
    sort -r -n -k 2 -t $'\t' 
    
  • + 0 comments

    Simple One Line Code

    sort -r -n -k 2 -t $'\t'