Sort a text file by line length including spaces

后端 未结 11 2165
故里飘歌
故里飘歌 2020-11-27 11:21

I have a CSV file that looks like this

AS2345,ASDF1232, Mr. Plain Example, 110 Binary ave.,Atlantis,RI,12345,(999)123-5555,1.56
AS2345,ASDF1232, Mrs. Plain Exampl         


        
11条回答
  •  天涯浪人
    2020-11-27 11:41

    Try this command instead:

    awk '{print length, $0}' your-file | sort -n | cut -d " " -f2-
    

提交回复
热议问题