http://qs321.pair.com?node_id=1106379


in reply to Re^4: Print entire line
in thread Print entire line

It's essentially the same program, with a different comparison:

my $filename = '/Users/Pabli/Desktop/do_human_mapping.gmt'; my $match = 'IL4'; open(my $file, '<', $filename) or die "open: $!"; while (<$file>){ my ($name,$id,@genes) = split /\t/; print $id,$/ if grep/^$match$/, @genes; }

Happy to help, but the hope is that you're working towards being able to construct these lil programs for yourself!

Replies are listed 'Best First'.
Re^6: Print entire line
by pabla23 (Novice) on Nov 06, 2014 at 15:15 UTC
    Thanks a lot "Loops" you are amazing!!!