【发布时间】:2010-12-28 06:04:52
【问题描述】:
这似乎真的是一项容易的任务,但是对于编程世界来说是全新的,我对以下任务有疑问: 我有一个大文件,格式如下:
track type= wiggle name09
variableStep chrom=chr1
34 5
36 7
54 8
variableStep chrom=chr2
33 4
35 2
78 7
this is text with the word random in it# this we need to remove
82 4
88 6
variableStep chrom=chr3
78 5
89 4
56 7
现在我想要的只是输出
一个名为 1 的文件 并且只包含
34 5
36 7
54 8
a second file called 2
33 4
35 2
78 7
82 4
88 6
a third file
78 5
89 4
56 7
如果能在这方面获得一些帮助会很棒... 如果有人知道如何在 R 中做到这一点......那就更好了
【问题讨论】:
-
sometext_sometext是否以数字开头? -
no... 格式为 variableStep chrom=chr1 data data data variableStep chrom=chr2 data data ...
-
实际上会一直到 chr22 然后继续 chrx。
-
给出一个实际的样本,不要猜测......