免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
12
最近访问板块 发新帖
楼主: cwd0204
打印 上一主题 下一主题

[文本处理] 文本处理 [复制链接]

求职 : 机器学习
论坛徽章:
79
2015年亚洲杯纪念徽章
日期:2015-05-06 19:18:572015七夕节徽章
日期:2015-08-21 11:06:172015亚冠之阿尔纳斯尔
日期:2015-09-07 09:30:232015亚冠之萨济拖拉机
日期:2015-10-21 08:26:3915-16赛季CBA联赛之浙江
日期:2015-12-30 09:59:1815-16赛季CBA联赛之浙江
日期:2016-01-10 12:35:21技术图书徽章
日期:2016-01-15 11:07:2015-16赛季CBA联赛之新疆
日期:2016-02-24 13:46:0215-16赛季CBA联赛之吉林
日期:2016-06-26 01:07:172015-2016NBA季后赛纪念章
日期:2016-06-28 17:44:45黑曼巴
日期:2016-06-28 17:44:4515-16赛季CBA联赛之浙江
日期:2017-07-18 13:41:54
11 [报告]
发表于 2016-06-29 22:44 |只看该作者
在 vim 中打开  原始文本 在命令行模式下输入
  1. :%s/\(.*\)/ select b.valule,a.event,a.match,a.function from match_item a,match_keys b where a.match  = b.match_keys and b.value in ('\1');/g
复制代码
即可。。。。

论坛徽章:
6
羊年新春福章
日期:2015-03-03 17:16:28双子座
日期:2015-03-03 17:16:56巳蛇
日期:2015-03-03 17:17:2415-16赛季CBA联赛之福建
日期:2016-03-11 09:05:00黑曼巴
日期:2016-07-07 16:58:1215-16赛季CBA联赛之吉林
日期:2016-11-14 09:23:07
12 [报告]
发表于 2016-07-01 10:28 |只看该作者
sed -r "s/.*/\(\'&\'\)\;/;iselect b.valule,a.event,a.match,a.function from match_item a,match_keys b where a.match  = b.match_keys and b.value in " file
select b.valule,a.event,a.match,a.function from match_item a,match_keys b where a.match  = b.match_keys and b.value in
('C03-4217499-4390464');
select b.valule,a.event,a.match,a.function from match_item a,match_keys b where a.match  = b.match_keys and b.value in
('C03-8473006-1196029');
select b.valule,a.event,a.match,a.function from match_item a,match_keys b where a.match  = b.match_keys and b.value in
('C03-8643511-3897621');
select b.valule,a.event,a.match,a.function from match_item a,match_keys b where a.match  = b.match_keys and b.value in
('C03-6168838-3011236');
select b.valule,a.event,a.match,a.function from match_item a,match_keys b where a.match  = b.match_keys and b.value in
('C03-1043117-2585643');
select b.valule,a.event,a.match,a.function from match_item a,match_keys b where a.match  = b.match_keys and b.value in
('D01-8943832-9343544');
select b.valule,a.event,a.match,a.function from match_item a,match_keys b where a.match  = b.match_keys and b.value in
('D01-5102042-2578762');
select b.valule,a.event,a.match,a.function from match_item a,match_keys b where a.match  = b.match_keys and b.value in
('D01-2105627-6887102');
select b.valule,a.event,a.match,a.function from match_item a,match_keys b where a.match  = b.match_keys and b.value in
('D01-4673776-6721425');
select b.valule,a.event,a.match,a.function from match_item a,match_keys b where a.match  = b.match_keys and b.value in
('D01-4827708-6153861');

论坛徽章:
0
13 [报告]
发表于 2016-07-01 11:28 |只看该作者
  1. ]# sed "s/.*/select b.valule,a.event,a.match,a.function from match_item a,match_keys b where a.match  = b.match_keys and b.value in \n ('&');/" q22
  2. select b.valule,a.event,a.match,a.function from match_item a,match_keys b where a.match  = b.match_keys and b.value in
  3. ('C03-4217499-4390464');
  4. select b.valule,a.event,a.match,a.function from match_item a,match_keys b where a.match  = b.match_keys and b.value in
  5. ('C03-8473006-1196029');
  6. select b.valule,a.event,a.match,a.function from match_item a,match_keys b where a.match  = b.match_keys and b.value in
  7. ('C03-8643511-3897621');
  8. select b.valule,a.event,a.match,a.function from match_item a,match_keys b where a.match  = b.match_keys and b.value in
  9. ('C03-6168838-3011236');
  10. select b.valule,a.event,a.match,a.function from match_item a,match_keys b where a.match  = b.match_keys and b.value in
  11. ('C03-1043117-2585643');
  12. select b.valule,a.event,a.match,a.function from match_item a,match_keys b where a.match  = b.match_keys and b.value in
  13. ('D01-8943832-9343544');
  14. select b.valule,a.event,a.match,a.function from match_item a,match_keys b where a.match  = b.match_keys and b.value in
  15. ('D01-5102042-2578762');
  16. select b.valule,a.event,a.match,a.function from match_item a,match_keys b where a.match  = b.match_keys and b.value in
  17. ('D01-2105627-6887102');
  18. select b.valule,a.event,a.match,a.function from match_item a,match_keys b where a.match  = b.match_keys and b.value in
  19. ('D01-4673776-6721425');
  20. select b.valule,a.event,a.match,a.function from match_item a,match_keys b where a.match  = b.match_keys and b.value in
  21. ('D01-4827708-6153861');
复制代码

论坛徽章:
10
15-16赛季CBA联赛之同曦
日期:2016-06-11 19:22:4115-16赛季CBA联赛之深圳
日期:2020-05-31 16:13:5615-16赛季CBA联赛之同曦
日期:2020-01-28 12:42:47每日论坛发贴之星
日期:2016-08-09 06:20:00程序设计版块每日发帖之星
日期:2016-08-09 06:20:00每日论坛发贴之星
日期:2016-07-12 06:20:00程序设计版块每日发帖之星
日期:2016-07-12 06:20:00程序设计版块每日发帖之星
日期:2016-07-06 06:20:00程序设计版块每日发帖之星
日期:2016-07-04 06:20:0015-16赛季CBA联赛之佛山
日期:2021-02-26 09:33:41
14 [报告]
发表于 2016-07-01 12:26 |只看该作者
awk '{print "select b.valule,a.event,a.match,a.function from match_item a,match_keys b where a.match  = b.match_keys and b.value in ";print "(\047"$0"\047);"}'
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP