Hi QM.. thanks for everything! After some modification on the matching of the "Sequence : Contig.." part, the script finally working! I disable the warning output, so it looks abit nicer when running the script.. here is the modified one. Thank u again QM! And thanks to everyone who helped!
#!/bin/perl/
my $sequence;
while (my $line = <>)
{
# Sequence keyword
if ($line =~ /^Sequence:\s+(\S+)/)
{
$sequence = $1; # save the sequence
next;
}
# Parameter keyword
next if ($line =~ /^Parameters:\s+(.*)$/);
# print any other non-blank lines
if ($line != /^\s+$/)
{
print "$sequence $line";
next;
}
}