ch05 ex editor

A Q in the command mode of vi invokes ex. Any time you are
in ex, the command vi returns you to vi editor.


{Editing with ex}

Full name AbbreviationMeaning
delete d Delete lines
move m Move lines
copy co Copy lines
t Copy lines (a synonym of co)


{Line Address}

For each ex editing command, you have to tell ex which line
number(s) to edit.


You can specify line address in several ways:
* With explicit line numbers
* With symbols that help you specify line numbers relative
  to your current position in the file.
* With search patterns as addresses that identify the lines
  to be affected.


:3,18d Delete lines 3 through 18.
:160,224m23 Move lines 160 through 224 to follow line 23.
(Like delete and put in vi.)
:23,29co100 Copy lines 23 through 29 and put after line 100.
(Like yank and put in vi.)


:= Print the total number of lines.
:.= Print the line number of the current line.
:/pattern/= Print the line number of the first line
that matches pattern.

{Line Addressing Symbols}

. stands for the current line
$ the last line of the file
% every line in the file


:.,$d
Delete from current line to end of file.
:20,.m$
Move from line 20 through the current line to the 
end of the file
:%d
Delete all the lines in a file
:%t$
Copy all lines and place them at the end of the file
(making a consecutive duplicate).


In addtion to an absolute line address, you can specify 
an address relative to the current line.
:.,.+20d
Delete from current line through the next 20 lines.
:226,$m.-2
Move lines 226 through the end of the file to two lines
above the current line.
:.,+20#
Display line numbers from the current line to 20 lines
above the current line.
:-,+t0
Copy three lines(the line above the cursor through
the line below the cursor) and put them at the top
of the file.


{copying a File into Another File}



:read filename(:r filename)
inserts the contents of filename starting on the line
after the cursor position in the file.
:185r /home/tim/data
Read in file data and place it after line 185
:$r /home/tim/data
Place the read-in file at the end of the current file.
:0r /home/tim/data
Place the read-in file at the very beginning of the
current file.
:/pattern/r /home/tim/data
Place the read-in file in the current file, after the 
line containing pattern.


{Editing Multiple Files}



{Edits Between Files}

When you give a yank buffer a one-letter name, you have a
convenient way to move text from one file to another. Named
buffers are not cleared when a new file is loaded into the
vi buffer with the :e command. Thus, by yanking or deleting
text from one file (into multiple named buffers if necessary), calling in a new file with :e, and putting the named
buffer(s) into the new file, you can transfer material 
between files.


"f4yy
Yank four lines into buffer f.
:w
Save the file
:e letter
Enter the file letter with :e. Move the cursor to where
the copied text will be placed.
"fp
Place yanked text from named buffer f below the cursor.


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.


[Exa]
:160,224ya a
yank lines 160 through 240 into buffer a.
Next 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 current line.
Stkcd [股票代码] ShortName [股票简称] Accper [统计截止日期] Typrep [报表类型编码] Indcd [行业代码] Indnme [行业名称] Source [公告来源] F060101B [净利润现金净含量] F060101C [净利润现金净含量TTM] F060201B [营业收入现金含量] F060201C [营业收入现金含量TTM] F060301B [营业收入现金净含量] F060301C [营业收入现金净含量TTM] F060401B [营业利润现金净含量] F060401C [营业利润现金净含量TTM] F060901B [筹资活动债权人现金净流量] F060901C [筹资活动债权人现金净流量TTM] F061001B [筹资活动股东现金净流量] F061001C [筹资活动股东现金净流量TTM] F061201B [折旧摊销] F061201C [折旧摊销TTM] F061301B [公司现金流1] F061302B [公司现金流2] F061301C [公司现金流TTM1] F061302C [公司现金流TTM2] F061401B [股权现金流1] F061402B [股权现金流2] F061401C [股权现金流TTM1] F061402C [股权现金流TTM2] F061501B [公司自由现金流(原有)] F061601B [股权自由现金流(原有)] F061701B [全部现金回收率] F061801B [营运指数] F061901B [资本支出与折旧摊销比] F062001B [现金适合比率] F062101B [现金再投资比率] F062201B [现金满足投资比率] F062301B [股权自由现金流] F062401B [企业自由现金流] Indcd1 [行业代码1] Indnme1 [行业名称1] 季度数据,所有沪深北上市公司的 分别包含excel、dta数据文件格式及其说明,便于不同软件工具对数据的分析应用 数据来源:基于上市公司年报及公告数据整理,或相关证券交易所、各部委、省、市数据 数据范围:基于沪深北证上市公司 A股(主板、中小企业板、创业板、科创板等)数据整理计算
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值