看板Linux
标 题Re: [问题] 关於VI取代的问题
发信站交大资科_BBS (Thu Mar 22 11:12:17 2007)
转信站ptt!ctu-reader!ctu-peer!news.nctu!news.cis.nctu!cis_nctu
看这格式,应该是找 "units" 前的四位数做代换才对。
%s/\([0-9][0-9]\)\([0-9][0-9]\) units/\1.\2 units/
==> 在 [email protected] (风中的企鹅) 的文章中提到:
> 指令如下:
> 0,$s/1742\ 1938\ 2134/17.42\ 19.38\ 21.34/g
> ※ 引述《[email protected] ()》之铭言:
> : 我有一个档案资料要处理
> : 是文字与数字的组合,其中我想要把某些特定位置的数字作处理
> : 例如下面的情况
> : thermo_region3 block 0 36.15 0 36.15 2 1742 units box
> : thermo region thermo_region3
> : thermo_region4 block 0 36.15 0 36.15 2 1938 units box
> : thermo region thermo_region4
> : thermo_region5 block 0 36.15 0 36.15 2 2134 units box
> : thermo region thermo_region5
> : 其中我希望 把1742 1938 2134 改成 17.42 19.38 21.34
> : 请问VI 可以完成这种需求吗
> : 谢谢
--
* Origin: ★ 交通大学资讯科学系 BBS ★ <bbs.cis.nctu.edu.tw: 140.113.23.3>