At 12:45 -0700 11/6/09, JohnL wrote:

>I want to turn the numerals in these lines
>
>  >lorem ipso 240
>>nother ipso 241
>>mas ipsos 242
>>  ...
>  >fini ipsos 26x
>
>into new numbers so that this is the result
>
>>lorem ipso 487
>>nother ipso 488
>>mas ipsos 489
>>  ...
>  >fini ipsos 50x


In this case a Unix filter:

#!/usr/bin/perl
while(<>){
   s~\d+$~$&+247~e;
   print;
}

This assumes your numbers are at the end of the lines and that you 
want to augment them all by 247.

If you have a list, as you suggest in the subject but not in the body 
of your message, then something like this:

#!/usr/bin/perl
my @list = split /\s+/,
"123 555 435 222";
while(<>) {
   s~\d+$~$list[0]~;
   shift @list;
   print;
}

JD


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "BBEdit Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/bbedit?hl=en
If you have a specific feature request or would like to report a suspected (or 
confirmed) problem with the software, please email to "[email protected]" 
rather than posting to the group.
-~----------~----~----~----~------~----~------~--~---

Reply via email to