On Wed, 6 Nov 2013 23:51:04 +0000 "Wang, Li" <li.w...@ttu.edu> wrote:
> Dear Perl Users > > I have hundreds of input files, named as geneName_paml_formated.mlc > In each file, there are some contents similar as follows: > > w (dN/dS) for branches: 0.00010 1.07967 145.81217 0.00010 > dN & dS for each branch > branch t N S dN/dS dN dS N*dN S*dS > 4..5 0.000 1103.3 327.7 0.0001 0.0000 0.0000 0.0 0.0 > 5..1 0.043 1103.3 327.7 1.0797 0.0144 0.0134 15.9 4.4 [...] > I want to extract the line start with "5..1" to be extracted and [...] [...] > It turns out that it didnot work, and seems that the script cannot > find my expression pattern $line=~m/^5\.\.1/ You're looking for a line starting with 5, but it doesn't - it starts with some whitespace, then 5. /^\s*5\.\.1/ should match. (\s* allowing zero or more whitespace characters before the 5) -- David Precious ("bigpresh") <dav...@preshweb.co.uk> http://www.preshweb.co.uk/ www.preshweb.co.uk/twitter www.preshweb.co.uk/linkedin www.preshweb.co.uk/facebook www.preshweb.co.uk/cpan www.preshweb.co.uk/github -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/