- 论坛徽章:
- 0
|
文档1.txt内容:
select * from dwetlv
;
+--------------------------------------------------------------+
insert into ;
select * from xxxxx;
insert into
;
select * from dwetlv
where a='1';
INSERT into ...
select a from xxxx
insert into select *
select *
insert *
where b='123';
select * from xxxxx
;insert into
;
文档2.txt内容:
select
insert
create
del
update
我的目的是 2.txt为关键字标示 从1.txt中找到关键字,并在关键字前面+上[A],在关键字后第一个分号后+[/A],在第一个关键字出现到分号结束中间的其他关键字忽略不加标记
操作系统:HP-UNIX 不要用sed
结果需求1.txt修改:
[A]
select * from dwetlv
;
[/A]
+--------------------------------------------------------------+
[A]
insert into ;
[/A]
[A]
select * from xxxxx;
[/A]
[A]
insert into
;
[/A]
[A]
select * from dwetlv
where a='1';
[/A]
[A]
INSERT into ...
select a from xxxx
insert into select *
select *
insert *
where b='123';
[/A]
[A]
select * from xxxxx
;
[/A]
[A]
insert
into
;
[/A] |
|