源文件为:

[root@luo5 wangxx]# cat -v luo.txt
J Luo
Soutth jfsa
Nanjing,china

Y Zhang
Victory University
Nejflja,Australia

D Hou
Beijing University
Melhouse,china

 

 

实现排序

[root@luo5 wangxx]# cat luo.txt |awk -v RS="" '{gsub("\n","@");print}' | sort | awk -v OFS="\n\n" '{gsub("@","\n");print}'
D Hou
Beijing University
Melhouse,china
J Luo
Soutth jfsa
Nanjing,china
Y Zhang
Victory University
Nejflja,Australia

 

相关文章:

  • 2022-01-20
  • 2022-12-23
  • 2021-10-28
  • 2022-01-25
  • 2021-11-23
  • 2021-11-19
  • 2021-10-07
  • 2021-10-14
猜你喜欢
  • 2021-11-11
  • 2021-07-13
  • 2021-11-24
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案