-
Notifications
You must be signed in to change notification settings - Fork 0
/
ChunkSelect.pl
54 lines (42 loc) · 896 Bytes
/
ChunkSelect.pl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#!/usr/bin/perl
use strict;
use warnings;
open DATATABLE, "AlwaysRightData.tsv" or die $!;
open SAVE, "AlwaysRightChunksShortened.txt" or die$!;
open OUTPUT, ">", "AlwaysRightData5and5.tsv" or die$!;
my @toSave = <SAVE>;
chomp(@toSave);
my $firstLine = <DATATABLE>;
print OUTPUT ($firstLine);
my @labelUsed;
for my $i (0 .. @toSave - 1)
{
$labelUsed[$i] = 0;
}
while (<DATATABLE>) {
my $line = $_;
$line =~ /([\w|-]*)\t.*/;
#print($1);
for my $i (0 .. @toSave - 1)
{
#print $_;
if(index($1,$toSave[$i]) != -1)
{
$labelUsed[$i] = 1;
#print $_;
print OUTPUT ($line);
}
}
}
print("Done");
#for my $i (0 .. @toSave - 1)
#{
# if(!$labelUsed[$i])
# {
# print($i);
# print("\n");
# }
#}
close DATATABLE ;
close SAVE;
close OUTPUT;