in reply to Text manipulation on a file with multiple entries, obo format
I don't quite get your problem but as far as i understood you want soimething like this:
Did I get it right?use strict; use Data::Dumper; open(IN, "<", "in.obo") || die "$!"; my %hash; my $term; while(<IN>){ chomp; if(/^id\:\s+(.*)/){ $term = $1; }elsif(/^is\_a\:\s+.*?\s+\!\s+(.*)/){ push(@{$hash{$term}},$1); } } close IN; print Dumper(\%hash);
PS: code not tested
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Text manipulation on a file with multiple entries, obo format
by Sakti (Novice) on Oct 01, 2015 at 21:39 UTC |