【vim】复制一个文件中的数据到另一个文件中(使用缓冲区)
2013-02-26 15:55
363 查看
(方法一)从文件a中复制4行数据到文件b中
vi a
"f4yy
:w
:e b
"fp
(方法二)
Another way to move text from one file to another is to use the ex commands :ya (yank)
and :pu (put). These commands work the same way as the equivalent vi commands
y and p, but they are used with ex’s line-addressing capability and named buffers.
For example:
:160,224ya a
would yank (copy) lines 160 through 224 into buffer a. Next you would move
with :e to the file where you want to put these lines. Place the cursor on the line where
you want to put the yanked lines. Then type:
:pu a
to put the contents of buffer a after the current line.
vi a
"f4yy
:w
:e b
"fp
(方法二)
Another way to move text from one file to another is to use the ex commands :ya (yank)
and :pu (put). These commands work the same way as the equivalent vi commands
y and p, but they are used with ex’s line-addressing capability and named buffers.
For example:
:160,224ya a
would yank (copy) lines 160 through 224 into buffer a. Next you would move
with :e to the file where you want to put these lines. Place the cursor on the line where
you want to put the yanked lines. Then type:
:pu a
to put the contents of buffer a after the current line.
相关文章推荐
- 使用C++ 复制一个文件夹下的所有文件到另一个文件夹
- python 文件处理模块的使用,给一个文件写入数据
- 两个文件,按照一个文件中的某一列筛选另一个文件中的数据
- 使用管道流和多线程完成以下任务要求: 一个线程对象t1 会从控制台中不停的读取信息,读到之后把数据交给管道输出流,把数据写到管道里面 ,另一个线程对象t2 不停的使用管道输入流从管道
- 本人写的如何使用DFS API 合并为一个大的天气数据文件
- mysql同主机下 复制一个数据库所有文件到另一个数据库
- ORACLE模拟一个数据文件坏块并使用RMAN备份来恢复
- 2.5 使用Groovy导入CSV文件的数据到一个内存模式的H2数据库
- parquet文件格式——本质上是将多个rows作为一个chunk,同一个chunk里每一个单独的column使用列存储格式,这样获取某一row数据时候不需要跨机器获取
- 使用反射将一个对象的值复制给另一个对象(同一个对象或者基于同一个基类)
- 《将一个磁盘文件中的信息复制到另一个磁盘文件中(怎样向文件读写字符)》
- sqlyog中,将一个数据库中的表(数据)复制到另一个数据库
- 如何使用Fread和Fwrite写一个复制文件的函数
- 怎么把一个集合的数据复制到另一个集合 不是引用传递(地址传递)
- 使用IDLE在一个py文件中引用另一个py中的类或函数
- unserialize的这个问题是由一个emlog论坛用户在使用时报错而发现的 问题表现情况如下: emlog缓存的保存方式是将php的数据对象(数组)序列化(serialize)后以文件的形式存放,
- 在Linux中使用vi/vim打开一个文件时出现的的问题
- 在Web.Config文件中使用configSource,避免动态修改web.config导致asp.net重启(另添加一个Config文件用于管理用户数据)
- sql server把一个表中数据复制到另一个表
- vim中如何将一个文件的内容拷贝到另一个文件中