免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
12下一页
最近访问板块 发新帖
查看: 8498 | 回复: 19
打印 上一主题 下一主题

每三个文件合并为一个大文件 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2010-09-27 20:22 |只看该作者 |倒序浏览
在某个目录下有 file01,file02,file03,...,file99 个文件
   现在想按顺序每三个文件合并一个大文件并重新命名
   如
     file01,file02,file03合并位大文件的名称位 :file01-03
        其它以此类推。
     问问大家有什么好的方法?
     我的有点繁琐,

论坛徽章:
0
2 [报告]
发表于 2010-09-27 20:39 |只看该作者
如有三个文件
  cat file01

  1.    set arrow from 7,1633 to 8,1383
  2.    set label "9575(100916104th)" at 6.5,1683
  3.    plot "diff_029.file" with linespoints
复制代码
cat file02

  1.    set arrow from 7,1633 to 8,1383
  2.    set label "9575(100916104th)" at 6.5,1683
  3.    plot "diff_030.file" with linespoints
复制代码
cat file03

  1.    set arrow from 7,1633 to 8,1383
  2.    set label "9575(100916104th)" at 6.5,1683
  3.    plot "diff_031.file" with linespoints
复制代码
合并新文件名为:file01-03
  cat file01-03

  1.    set arrow from 7,1633 to 8,1383
  2.    set label "9575(100916104th)" at 6.5,1683
  3.     set arrow from 7,1633 to 8,1383
  4.    set label "9575(100916104th)" at 6.5,1683
  5.    set arrow from 7,1633 to 8,1383
  6.    set label "9575(100916104th)" at 6.5,1683
  7.    plot "diff_029.file" with linespoints, "diff_030.file" with linespoints,"diff_031.file" with linespoints
  8.   
复制代码

论坛徽章:
5
2015年辞旧岁徽章
日期:2015-03-03 16:54:152015年迎新春徽章
日期:2015-03-04 09:50:282015年亚洲杯之朝鲜
日期:2015-03-13 22:47:33IT运维版块每日发帖之星
日期:2016-01-09 06:20:00IT运维版块每周发帖之星
日期:2016-03-07 16:27:44
3 [报告]
发表于 2010-09-27 21:04 |只看该作者
你的方法呢?

论坛徽章:
0
4 [报告]
发表于 2010-09-27 21:06 |只看该作者
回复 1# addictlinux


    你的所有这些文件都是这样的吗?都只有这么几行吗?

论坛徽章:
5
2015年辞旧岁徽章
日期:2015-03-03 16:54:152015年迎新春徽章
日期:2015-03-04 09:50:282015年亚洲杯之朝鲜
日期:2015-03-13 22:47:33IT运维版块每日发帖之星
日期:2016-01-09 06:20:00IT运维版块每周发帖之星
日期:2016-03-07 16:27:44
5 [报告]
发表于 2010-09-27 21:08 |只看该作者
灰太郎来了,还有什么搞不定?

论坛徽章:
5
2015年辞旧岁徽章
日期:2015-03-03 16:54:152015年迎新春徽章
日期:2015-03-04 09:50:282015年亚洲杯之朝鲜
日期:2015-03-13 22:47:33IT运维版块每日发帖之星
日期:2016-01-09 06:20:00IT运维版块每周发帖之星
日期:2016-03-07 16:27:44
6 [报告]
发表于 2010-09-27 21:10 |只看该作者
cat file01 file02 file03>file01-03
cat file04 file05 file06>file04-06
cat file07 file08 file09>file07-09
cat file10 file11 file12>file10-12
cat file13 file14 file15>file13-15
cat file16 file17 file18>file16-18
cat file19 file20 file21>file19-21
cat file22 file23 file24>file22-24
cat file25 file26 file27>file25-27
cat file28 file29 file30>file28-30
cat file31 file32 file33>file31-33
cat file34 file35 file36>file34-36
cat file37 file38 file39>file37-39
cat file40 file41 file42>file40-42
cat file43 file44 file45>file43-45
cat file46 file47 file48>file46-48
cat file49 file50 file51>file49-51
cat file52 file53 file54>file52-54
cat file55 file56 file57>file55-57
cat file58 file59 file60>file58-60
cat file61 file62 file63>file61-63
cat file64 file65 file66>file64-66
cat file67 file68 file69>file67-69
cat file70 file71 file72>file70-72
cat file73 file74 file75>file73-75
cat file76 file77 file78>file76-78
cat file79 file80 file81>file79-81
cat file82 file83 file84>file82-84
cat file85 file86 file87>file85-87
cat file88 file89 file90>file88-90
cat file91 file92 file93>file91-93
cat file94 file95 file96>file94-96
cat file97 file98 file99>file97-99

论坛徽章:
0
7 [报告]
发表于 2010-09-27 21:12 |只看该作者
回复 4# sunbw001


    呵呵,想从固定行上动脑筋。
   每个文件行数大小不一。

论坛徽章:
0
8 [报告]
发表于 2010-09-27 21:12 |只看该作者
黑哥太有才了

论坛徽章:
5
2015年辞旧岁徽章
日期:2015-03-03 16:54:152015年迎新春徽章
日期:2015-03-04 09:50:282015年亚洲杯之朝鲜
日期:2015-03-13 22:47:33IT运维版块每日发帖之星
日期:2016-01-09 06:20:00IT运维版块每周发帖之星
日期:2016-03-07 16:27:44
9 [报告]
发表于 2010-09-27 21:18 |只看该作者
回复 8# where27


    前段时间发大水,你是不是也大赚了一把?

论坛徽章:
5
2015年辞旧岁徽章
日期:2015-03-03 16:54:152015年迎新春徽章
日期:2015-03-04 09:50:282015年亚洲杯之朝鲜
日期:2015-03-13 22:47:33IT运维版块每日发帖之星
日期:2016-01-09 06:20:00IT运维版块每周发帖之星
日期:2016-03-07 16:27:44
10 [报告]
发表于 2010-09-27 21:20 |只看该作者
回复 2# addictlinux


    嗯?是这样合并啊,那我的方法不对。
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

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

清除 Cookies - ChinaUnix - Archiver - WAP - TOP