Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
@files = @ARGV; $size = @files; open (FA, ">>comp.txt"); open (FH, @ARGV[0]); while ($seq = <FH>) { chomp $seq; @seq = split ("\t", $seq); $seqm = @seq[0]; chomp $seqm; open (FH1, @ARGV[1]); while ($seq2 = <FH1>) { chomp $seq2; @seq2 = split ("\t", $seq2); $seqm1 = @seq2[0]; chomp $seqm1; if ($seqm1 =~m/$seqm/) {$names=$names."\n".$seq."\t".@seq2[1]."\n"; $c=1; last;} else {$c=0;} } if ($c=="0") {$names=$names."\n".$seq."\n";} } open (FH, @ARGV[1]); while ($seq = <FH>) { chomp $seq; @seq = split ("\t", $seq); $seqm = @seq[0]; chomp $seqm; open (FH1, @ARGV[2]); while ($seq2 = <FH1>) { chomp $seq2; @seq2 = split ("\t", $seq2); $seqm1 = @seq2[0]; chomp $seqm1; if ($seqm1 =~m/$seqm/) { $c=1; last;} else {$c=0;} } if ($c=="0") {$names1=$names1."\n".$seq."\n";} } print FA $names."\n".$names1;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: find unique lines in two files
by Linicks (Scribe) on Oct 28, 2016 at 12:34 UTC | |
by Phenomanan (Monk) on Oct 28, 2016 at 13:24 UTC | |
|
Re: find unique lines in two files
by hippo (Archbishop) on Oct 28, 2016 at 12:36 UTC | |
|
Re: find unique lines in two files
by Laurent_R (Canon) on Oct 28, 2016 at 18:03 UTC | |
|
Re: find unique lines in two files
by tybalt89 (Monsignor) on Oct 28, 2016 at 21:10 UTC |