Skip to main content
Became Hot Network Question
added 7 characters in body
Source Link
terdon
  • 252.7k
  • 69
  • 481
  • 719

SORT commandGNU sort on Linux is not giving expected results on my csv file. Can you please help to resolve the situation/ issue?

Input file

[nscruser]$ cat cemp1.txt 10,30 50,900 20,1050 

Objective I need to do numeric sort on the first field for the above file

[nscruser]$ sort -t',' -k1 -n cemp1.txt 10,30 50,900 20,1050 

Expected output But I expected the output as below as I am doing a numeric sort on first column

10,30 20,1050 50,900 

Can someone please let me know why the discrepancy?

SORT command is not giving expected results on my csv file. Can you please help to resolve the situation/ issue?

Input file

[nscruser]$ cat cemp1.txt 10,30 50,900 20,1050 

Objective I need to do numeric sort on the first field for the above file

[nscruser]$ sort -t',' -k1 -n cemp1.txt 10,30 50,900 20,1050 

Expected output But I expected the output as below as I am doing a numeric sort on first column

10,30 20,1050 50,900 

Can someone please let me know why the discrepancy?

GNU sort on Linux is not giving expected results on my csv file. Can you please help to resolve the situation/ issue?

Input file

[nscruser]$ cat cemp1.txt 10,30 50,900 20,1050 

Objective I need to do numeric sort on the first field for the above file

[nscruser]$ sort -t',' -k1 -n cemp1.txt 10,30 50,900 20,1050 

Expected output But I expected the output as below as I am doing a numeric sort on first column

10,30 20,1050 50,900 

Can someone please let me know why the discrepancy?

Source Link

sort command- numeric sort not working on csv

SORT command is not giving expected results on my csv file. Can you please help to resolve the situation/ issue?

Input file

[nscruser]$ cat cemp1.txt 10,30 50,900 20,1050 

Objective I need to do numeric sort on the first field for the above file

[nscruser]$ sort -t',' -k1 -n cemp1.txt 10,30 50,900 20,1050 

Expected output But I expected the output as below as I am doing a numeric sort on first column

10,30 20,1050 50,900 

Can someone please let me know why the discrepancy?