Hello all,
I've got a few files to extract information from, and i am having trouble with the multi-line query. i have paragraphs of information with a info line, followed by mulitple lines of text with no spaces, folowed by a blank line.
>infoline
manylinesof
text
>infoline
manylinesof
text
i really need each seaction ie paragraph without infoline
of" manylinesoftext" each to be stored as 1 element of an array, and the infoline to be stored in a second array. i have writen a multiline regexp but i think it stores all the txt paragraphs in 1 element. the code is below
while($line=<INPUT1>){
if($line=~m/^[a-z].*?\b$/xm){
$array[$i]= $line;
#print $array[$i];
print OUTFILE "$array[$i]";
$i++;
}
elsif ($line=~/^[>].*?/){
push @headers, $fastafile;
$i++;
}
else{}
}i was then going to reference each txt paragraph to $i-1 infoline. Any help on getting these of these multiline sections into seperate elements will be grateful.
txpip
I've got a few files to extract information from, and i am having trouble with the multi-line query. i have paragraphs of information with a info line, followed by mulitple lines of text with no spaces, folowed by a blank line.
Code:
>infoline
manylinesof
text
>infoline
manylinesof
text
i really need each seaction ie paragraph without infoline
of" manylinesoftext" each to be stored as 1 element of an array, and the infoline to be stored in a second array. i have writen a multiline regexp but i think it stores all the txt paragraphs in 1 element. the code is below
Code:
$i=0; while($line=<INPUT1>){
if($line=~m/^[a-z].*?\b$/xm){
$array[$i]= $line;
#print $array[$i];
print OUTFILE "$array[$i]";
$i++;
}
elsif ($line=~/^[>].*?/){
push @headers, $fastafile;
$i++;
}
else{}
}
txpip