- 论坛徽章:
- 0
|
本帖最后由 blind_fish 于 2016-08-25 20:54 编辑
[root@CentOS6min ~]# cat c.txt
INSERT INTO table_a VALUES ('a', 'b'), ('c', 'd');
INSERT INTO table_b VALUES ('a1', 'b'), ('c1', 'd');
INSERT INTO table_c VALUES ('a2', 'b'), ('c2', 'd');
[root@CentOS6min ~]#sed -nr "s@^([^\(]+)(.*)\,(.*,.*)@\1\2;\1\3@p" c.txt
INSERT INTO table_a VALUES ('a', 'b');INSERT INTO table_a VALUES ('c', 'd');
INSERT INTO table_b VALUES ('a1', 'b');INSERT INTO table_b VALUES ('c1', 'd');
INSERT INTO table_c VALUES ('a2', 'b');INSERT INTO table_c VALUES ('c2', 'd');
|
|