我有一个字符串列表:
python2-distutils-extra|==>|python2-distutils-extra|2.39-5|Enhancements to the Python build system
python2-fuse|==>|python2-fuse|1.0.5-1|This is a Python 2 interface to libfuse (https://github.com/libfuse/libfuse), a simple interface for userspace programs to export a virtual filesystem to the Linux kernel
python2-gobject2|==>|python2-gobject2|2.28.7-7|Legacy Python 2 bindings for GObject
python2-numpy|==>|python2-numpy|1.16.6-3|Scientific tools for Python 2
我想得到:
python2-distutils-extra ==> python2-distutils-extra 2.39-5
Enhancements to the Python build system
python2-fuse ==> python2-fuse 1.0.5-1
This is a Python 2 interface to libfuse (https://github.com/libfuse/libfuse), a simple interface for userspace programs to export a virtual filesystem to the Linux kernel
python2-gobject2 ==> python2-gobject2 2.28.7-7
Legacy Python 2 bindings for GObject
python2-numpy ==> python2-numpy 1.16.6-3
Scientific tools for Python 2
编辑:与第一列的长度对齐意味着“==>”始终位于同一位置(就像上面的代码一样)。
我已经尝试使用列来获取它,但我使用列的哪些选项并不重要,结果是:
python2-distutils-extra ==> python2-distutils-extra 2.39-5
Enhancements to the Python build system
python2-fuse ==> python2-fuse 1.0.5-1
This is a Python 2 interface to libfuse (https://github.com/libfuse/libfuse), a simple interface for userspace programs to export a virtual filesystem to the Linux kernel
python2-gobject2 ==> python2-gobject2 2.28.7-7
Legacy Python 2 bindings for GObject
python2-numpy ==> python2-numpy 1.16.6-3
Scientific tools for Python 2
请帮忙...
使用 GNU awk;我没有像您一样删除每行中的尾随空格:
与
awk
,column
和sed
: