18 |
# http://www.theseed.org/LICENSE.TXT. |
# http://www.theseed.org/LICENSE.TXT. |
19 |
# |
# |
20 |
|
|
21 |
|
=head1 Convert Tabbed Representation of Sets to Numbered Relational Representation |
22 |
|
|
23 |
|
This script takes as input a two-column tab-delimited file of numbered sets, |
24 |
|
each record containing (0) the set number and (1) a set element. It collapses |
25 |
|
each set onto a single output line, with each set being one |
26 |
|
record in the file. Thus, if the input file is |
27 |
|
|
28 |
|
1 a |
29 |
|
1 b |
30 |
|
1 c |
31 |
|
2 d |
32 |
|
2 e |
33 |
|
3 f |
34 |
|
4 g |
35 |
|
4 h |
36 |
|
|
37 |
|
the output would be |
38 |
|
|
39 |
|
a b c |
40 |
|
d e |
41 |
|
f |
42 |
|
g h |
43 |
|
|
44 |
|
|
45 |
|
=cut |
46 |
|
|
|
# usage: rel2tabs < 2-column-table > 1-column.version"; |
|
47 |
|
|
48 |
$_ = <STDIN>; |
$_ = <STDIN>; |
49 |
while (defined($_) && ($_ =~ /^(\S+)/)) |
while (defined($_) && ($_ =~ /^(\S+)/)) |