如何在vi中连接两行? [英] How do I join two lines in vi?

查看:46
本文介绍了如何在vi中连接两行?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在一个文本文件中有两行,如下所示:

I have two lines in a text file like below:

S<Switch_ID>_F<File type>
_ID<ID number>_T<date+time>_O<Original File name>.DAT

我想在 vi 中附加两行,如下所示:

I want to append the two lines in vi like below:

S<Switch_ID>_F<File type>_ID<ID number>_T<date+time>_O<Original File name>.DAT

第二行被删除,第二行的内容被附加到第一行.

The second line got deleted and the contents of the second line was appended to the first line.

如何在 vi 中使用命令模式执行此操作?

How could I do it using command mode in vi?

推荐答案

Shift+J 从当前行移除换行符,所以按J"在行中的任何位置,您都可以按照您想要的方式组合当前行和下一行.

Shift+J removes the line change character from the current line, so by pressing "J" at any place in the line you can combine the current line and the next line in the way you want.

这篇关于如何在vi中连接两行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆