在vim中重新格式化一个漂亮的列布局

前端之家收集整理的这篇文章主要介绍了在vim中重新格式化一个漂亮的列布局前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我有一个csv文件中的这个数据集
1.33570301776,3.61194e-06,7.24503e-06,-9.91572e-06,1.25098e-05,0.0102828,0.010352,0.0102677,0.0103789,0.00161604,0.00167978,0.00159998,0.00182596,0.0019804,0.0133687,0.010329,0.00163437,0.00191202,0.0134425 
1.34538754675,3.3689e-06,9.86066e-06,-9.12075e-06,1.18058e-05,0.00334344,0.00342207,0.00332897,0.00345504,0.00165532,0.00170412,0.00164234,0.00441903,0.00459294,0.00449357,0.00339737,0.00166596,0.00451926,0.00455153
1.34808186291,-1.99011e-06,6.53026e-06,-1.18909e-05,9.52337e-06,0.00158065,0.00166529,0.0015657,0.0017022,0.000740644,0.00078635,0.000730052,0.00219736,0.00238191,0.00212762,0.00163783,0.000750669,0.00230171,0.00217917

正如你可以看到,数字格式不同,不对齐。在vim中有一种方法可以正确快速地对齐列,所以结果是这样的

1.33570301776,0.00217917

这将是伟大的复制和粘贴部分与ctrl-v。任何提示

如果你是某种类型的UNIX(Linux等),你可以通过column(1)命令进行欺骗和过滤:
:%!column -t

猜你在找的Bash相关文章