Hello
I have to store 2 arrays out of the lines starting with part after the line of the CNTC 205
in other words i need to make a set of parts
@first_part of CNTC 205= 1 2
@second_part of CNTC 205= 4
I used a code like that
this works only with one END, any ideas how to modify this to work with 2 ENDS?
thanks alot in advance
I have to store 2 arrays out of the lines starting with part after the line of the CNTC 205
Code:
CNTC 205
PART 1 2
END
PART 4
END
in other words i need to make a set of parts
@first_part of CNTC 205= 1 2
@second_part of CNTC 205= 4
I used a code like that
Code:
sub part_entity_sel($)
{
my $line = shift;
my @rb;
push @rb, $line;
# get data
my $read_more = 1;
while ($read_more) {
$line = <DAT_PC>;
push @rb, $line;
$read_more = 0 if $line =~ m/^\s{8}END/;
}
# get parts
my @nlist;
foreach $line (@rb){
if ($line =~ m/^\s{8}PART/) {
(my $line2 = $line) =~ s/^\s*PART\s*//;
push @nlist, split(/\s+/, $line2);
}
}
return @nlist;
}
this works only with one END, any ideas how to modify this to work with 2 ENDS?
thanks alot in advance