linux - 在linux中水平排序
问题描述
我有一个像下面的文件有多个行和列,
a fn1.1 fn1.2 fn1.10 fn1.11
我想在文件中从第二个开始的列中进行字典排序。因此,每一行的输出应该是,
a fn1.1 fn1.10 fn1.11 fn1.2
我使用过,LC_ALL=C sort /path_to_file/file
但它没有提供所需的输出。例如,对于多行,
input
a fn1.1 fn1.2 fn1.10 fn1.11
b fn1.2 fn1.3 fn1.10 fn1.11
a fn1.10 fn1.20 fn1.13 fn1.12
desired output
a fn1.1 fn1.10 fn1.11 fn1.2
b fn1.10 fn1.11 fn1.2 fn1.3
a fn1.10 fn1.12 fn1.13 fn1.20
getting output
a fn1.1 fn1.2 fn1.10 fn1.11
a fn1.10 fn1.20 fn1.13 fn1.12
b fn1.2 fn1.2 fn1.10 fn1.11
请提出一些解决方案。
解决方案
推荐阅读
- vb.net - 如何应用每个像素的电影色调映射
- javascript - 检查多个属性是否全部存在或全部缺失
- python - For循环在两个数组中运行
- vb.net - 如何在 ms access 和 vb.net 中保存图像
- r - Julia中R的模拟功能的模拟?
- java - 如何异或两个不同长度的字节数组
- hadoop - 空目录的 Hadoop mv 命令错误
- php - 在几天内获得用户在 wordpress 中的连续登录
- javascript - 类中的 Javascript 数组属性仅在从函数调用时返回
- javascript - 如何使用 selenium 和 PhantomJS 从动态网站中提取值