- 论坛徽章:
- 0
|
回复 #1 juzi1114 的帖子
Another way is to use $/ ($INPUT_RECORD_SEPARATOR).
Because your data structure is typically with beginning of "CC -!-" terminated,
using $/ = "CC -!-" to seperate the records and to store then in each element of an array.
Then processing array's element to get what you want.
Sample code:
$/ = "CC -!-";
my @data = ();
while (<DATA>) {
chomp;
push @data, $_ if $_ ne '';
}
__DATA__
CC -!- FUNCTION: Rapidly .
CC -!- CATALYTIC ACTIVITY: Acetylcholine.
CC -!- SUBUNIT: Homotetramer; composed .
CC Interacts with PRIMA1.
CC anchor it to the basal
CC (By similarity).
CC -!- SUBCELLULAR LOCATION: Cell junction, synapse. Secreted (By
CC similarity). Cell membrane; Peripheral membrane protein (By
CC similarity).
CC -!- SUBCELLULAR LOCATION: Isoform 2: Cell membrane;
CC anchor; Extracellular side (By similarity).
CC -!- ALTERNATIVE PRODUCTS:
CC Event=Alternative splicing; Named isoforms=2; |
|