RE: extracting numbers from a string

2003-03-22 Thread yargo
do you mean that you want the 100 in a variable? If so, here is one way: while { # Splitting the line by white spaces. my $Number = (split /\s+/, $_)[0]; # Deleting the dot at the end. $Number =~ [EMAIL PROTECTED]@@; print "$Number\n"; } HTH, Yargo. -

Re: extracting numbers from a string

2003-03-22 Thread Steve Grazzini
Matthew Stapleton <[EMAIL PROTECTED]> wrote: > [...] I am wanting to read a line of a file and then > extract a digit from the beginning of the line. A > typical line looks something like this: > > 100. text text text > > So I am using a file handle to open the file and read > the lines on by

Re: extracting numbers from a string

2003-03-22 Thread beau
On 21 Mar 2003 at 20:32, Matthew Stapleton wrote: > Hello, > > I am learning Perl and having some fun with it. In a script I am writing > I am wanting to read a line of a file and then extract a digit from the > beginning of the line. A typical line looks something like this: > > 100. text tex

RE: extracting numbers from a string

2003-03-21 Thread Wagner, David --- Senior Programmer Analyst --- WGO
Matthew Stapleton wrote: > Hello, > > I am learning Perl and having some fun with it. In a script I am > writing I am wanting to read a line of a file and then extract a > digit from the beginning of the line. A typical line looks something > like this: > > 100. text text text > > So I am usi