Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个文件,其中每一行包含由单个空格分隔的数据。空格的总数因行而异,但总是大于 10。我希望只用制表符替换最后十个空格。最后十个之前存在的任何空格都应保持不变。
我怎样才能使用 vi 做到这一点?
You can make use of regular expressions for this purpose. Regex can be:
<Ten Spaces>$
or
[ ]{10}$
$ indicates search from the end.