"Brett Williams" <[EMAIL PROTECTED]> wrote in message ...
>
> That was a big help. I now have another problem however. I had assumed
> that adding a line number preceding the prices would be a trivial
> matter, however what i thought would work is not doing so. Here is the
> code ive tried.
>
> [snip]
>
> What i would like is for the output to look like
>
> 1: 1002.00
> 2: 125.00
> 3: 61864.35
> 4: 890876.99
> 5: 9.99

prompt> perl -ne "print ++$x, qq(: $1\n) if /^?.*<(.+)>/" record.txt

If you want to match only digits and decimal places:

prompt> perl -ne "print ++$x, qq(: $1\n) if /^?.*<([.\d]+)>/" record.txt

Keep in mind that the former will match ANYTHING between <>. The latter will 
match one or more digits and decimal places. Yes, it will match 3.2.2 which 
might not be what you want, but it gives you a good starting place.

-ZO 



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to