Basically I am reformatting a list that looks like this
ko10101
K01392
K09134
ko34231
K05789
ko13452
K04665
K07881
into a csv file that looks like this:
ko10101\tK01392
ko10101\tK01392
ko10101\tK09134
ko34231\tK05789
ko13452\tK04665
ko13452\tK07881
while (<OUT>) {
my $line = $_;
chomp;
if ($line =~ /^$/) {
next;
}
elsif ($line =~ /ko/) {
# $test = 1;
my $pathway = \$line;
# print "$pathway\t";
}
elsif ($line =~ /K/) {
trim($line);
print OUT2 "$$pathway\t$line\n";
}
else {
print OUT2 "problem with $line\n";
}
}
close OUT;