Sample Header Ad - 728x90

Sorting elements of a CSV file

1 vote
5 answers
494 views
I have a csv file with seven numbers per line like this: 1083,20,28,42,23,10,43 1084,20,5,29,59,40,33 1085,39,50,21,12,40,55 1086,45,4,6,23,10,2 1087,36,46,28,32,3,20 I want to keep the first number in place (column 1) and sort columns 2 to 7, making the file like 1083,10,20,23,28,42,43 1084,5,20,29,33,40,59 1085,12,21,39,40,50,55 1086,2,4,6,10,45,23 1087,3,20,28,32,36,46 How can I do that with awk, sed or whatever? Thanks
Asked by Duck (4794 rep)
Feb 26, 2019, 10:03 AM
Last activity: Mar 10, 2025, 10:35 PM