Or you can try: __BEGIN__ #!/usr/bin/perl use warnings; use strict; my @decimals; $_ = 'atom 12 N VAL A 1 12.435 13.66 34.6 32.1 32 a N'; push @decimals,$1 while (/(\d+\.?\d*)/g);
print "@decimals\n"; __END__ On Mon, 9 May 2005 19:04:08 +0530 Aditi Gupta <[EMAIL PROTECTED]> wrote: > Hi everybody, > > Can we use substr function for a string like: > $file = atom 12 N VAL A 1 12.435 13.66 34.6 32.1 32 a N > can the decimal numbers be extracted using > $x= substr($file, offset, length) > (the exact field lenghts of each field are known). > > Thanks in advance.. > > -- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > <http://learn.perl.org/> <http://learn.perl.org/first-response> > > > -- Whatever you do will be insignificant,but the important is you do it! It doesn't matter who you are, it's what you do that takes you far! -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>