A
Amy Lee
Hello,
Dose perl has functions like the UNIX command sort and uniq can output
duplicate lines and unique lines?
There's my codes, what if I run this it will output many lines but I just
want to save the duplicate line just once and unique line.
while (<>)
{
if (/^\>.*/)
{
s/\>//g;
if (/\w+\s\w+\s(.*)\smiR.*\s\w+/g)
{
print "$1\n";
}
}
}
The output is like this:
.......
Homo sapiens
Homo sapiens
Homo sapiens
Homo sapiens
Homo sapiens
Homo sapiens
Homo sapiens
Caenorhabditis elegans
Caenorhabditis elegans
Caenorhabditis elegans
Caenorhabditis elegans
Mus musculus
Mus musculus
Mus musculus
Mus musculus
Mus musculus
Mus musculus
Mus musculus
Arabidopsis thaliana
.........
And mu purpose is the output should be like that:
........
Homo sapiens
Caenorhabditis elegans
Mus musculus
Arabidopsis thaliana
........
Thank you very much~
Best Regards,
Amy Lee
Dose perl has functions like the UNIX command sort and uniq can output
duplicate lines and unique lines?
There's my codes, what if I run this it will output many lines but I just
want to save the duplicate line just once and unique line.
while (<>)
{
if (/^\>.*/)
{
s/\>//g;
if (/\w+\s\w+\s(.*)\smiR.*\s\w+/g)
{
print "$1\n";
}
}
}
The output is like this:
.......
Homo sapiens
Homo sapiens
Homo sapiens
Homo sapiens
Homo sapiens
Homo sapiens
Homo sapiens
Caenorhabditis elegans
Caenorhabditis elegans
Caenorhabditis elegans
Caenorhabditis elegans
Mus musculus
Mus musculus
Mus musculus
Mus musculus
Mus musculus
Mus musculus
Mus musculus
Arabidopsis thaliana
.........
And mu purpose is the output should be like that:
........
Homo sapiens
Caenorhabditis elegans
Mus musculus
Arabidopsis thaliana
........
Thank you very much~
Best Regards,
Amy Lee