On 13 Aug 2009, at 15:46, Marek Stepanek wrote:

>
> Carlton Gibson wrote:
>>
>> On 12 Aug 2009, at 23:29, pietro ildiscotto wrote:
>>
>>> Hello,
>>> I have  a text who look like this
>>>
>>> searchGetter.10.searchTerm=naim 62
>>> searchGetter.10.searchTermType=All of these words
>>> searchGetter.11.availableTo=
>>> searchGetter.11.categoryList=
>>> searchGetter.11.excludeWords=
>>> searchGetter.11.includeDescription=0
>>> searchGetter.11.locatedIn=
>>> searchGetter.11.onlyBIN=0
>>> searchGetter.11.quantityGreaterThanOne=0
>>> searchGetter.11.searchTerm=naim 62
>>> searchGetter.11.searchTermType=All of these words
>>> searchGetter.12.availableTo=
>>> searchGetter.12.categoryList=
>>> searchGetter.12.excludeWords=
>>> searchGetter.12.includeDescription=0
>>> searchGetter.12.locatedIn=
>>> searchGetter.12.onlyBIN=0
>>> searchGetter.12.quantityGreaterThanOne=0
>>> searchGetter.12.searchTerm=naim 62
>>> searchGetter.12.searchTermType=All of these words
>>> searchGetter.13.availableTo=
>>> searchGetter.13.categoryList=
>>> searchGetter.13.excludeWords=
>>> searchGetter.13.includeDescription=0
>>> searchGetter.13.locatedIn=
>>> searchGetter.13.onlyBIN=0
>>> searchGetter.13.quantityGreaterThanOne=0
>>> searchGetter.13.searchTerm=naim 62
>>> searchGetter.13.searchTermType=All of these words
>>>
>>> and I would like to replace every searchGetter.10. by searchGetter. 
>>> 16.
>>> and searchGetter.11 by searchGetter.17 and searchGetter.13. by
>>> searchGetter.18. etc...
>>>
>>> any godlike grep genius there to help me ? my head is hurting really
>>> bad !
>>> thanks in advance
>>>
>>> Pierre
>>
>> Hi Pierre,
>>
>> I think your best bet is to do it one step at a time (perhaps with a
>> text factory).
>>
>> First search for:
>>
>>> searchGetter.10.
>>
>> and replace with:
>>
>>> searchGetter.16.
>>
>> (No grep)
>>
>> Then repeat for the 11/17 and 11/18 pairs.
>>
>> Hope that helps.
>>
>> Regards,
>> Carlton
>>
>
>
> And here a Perl-Filter to do it in one step. You select the text to
> change and you run the following filter over it (you save this snippet
> into your folder: ~/Library/Application Support/Unix Support/Unix
> Filters/):
>
> #!/usr/bin/perl
>
> while(<>) {
>       s/(searchGetter\.)(\d+)/$1 . eval($2+6)/eg;
>       print;
> }
>
>

Just one problem: 13 + 6 is not 18. (The third replace.)

> Does this help?
>
>
> Best greetings to all
>
>
>
> marek
>
>
> >


--~--~---------~--~----~------------~-------~--~----~
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