Got a Perl filter that does what I need from Ronald on the BBedit Scripting
list.
Don't need the ones over 128 right now.
Thx,
Ken
>>Date: Mon, 17 Mar 2008 10:48:26 -0400
>>From: Ronald J Kimball <[EMAIL PROTECTED]>
>>Subject: Re: regex for converting decimal to ascii?
>>Message-ID: <[EMAIL PROTECTED]>
>>Content-Type: text/plain; charset=us-ascii
>>In-Reply-To: <[EMAIL PROTECTED]>
>>
>>On Mon, Mar 17, 2008 at 07:36:24AM -0400, Ken G. Brown wrote:
>>> I'm trying to figure out a way of converting a list of decimal
>>> representations of ascii characters, to their ascii character so I do not
>>> need to do it manually.
>>>
>>> (\d+) finds the decimal numbers and \1 in the replace field will put them
>>> back in, but how do i get them put back in as ascii characters?
>>>
>>> Thx for any tips.
>>
>>Here's a Perl solution, which you can run as a filter on the selected text.
>>
>>#!perl -p
>>
>>s/(\d+)/chr($1)/ge;
>>
>Ronald
At 8:54 AM -0400 3/18/08, Jan Leppink apparently wrote:
>Hi Ken,
>I think you must realise that ascii encoding is beyond the scope of grep.
>Especially for codes
>above 128 there are a lot of encodings that grep knows nothing about (and
>shouldn't).
>
>But I think there is a workaround by creating pattern and replacement arrays
>to get what you
>want. You can use Perl to create these arrays, But maybe it is easier to write
>the whole
>replacement in Perl and call that script from BBEdit.
>
>Hope this helps you,
>Jan Leppink.
>
>> I'm trying to figure out a way of converting a list of decimal
>> representations of ascii
>characters, to their
>> ascii character so I do not need to do it manually.
>>
>> (\d+) finds the decimal numbers and \1 in the replace field will put them
>> back in, but how do
>I get them
>> put back in as ascii characters?
>>
>> I'd like this:
>>
>> 35
>> 123
>> 86
>> 58
>>
>> to end up something like this:
>>
>> 35 #
>> 123 {
>> 86 V
>> 58 :
>>
>> or even better have the multiple lines end up like this on one line but I
>> think I can eventually
>figure that
>> out if I really want.
>>
>> #{V:
>>
>> Thx for any tips.
>>
>> Ken G. Brown
>>
>
>--
<>
--
------------------------------------------------------------------
Have a feature request? Not sure the software's working correctly?
If so, please send mail to <[EMAIL PROTECTED]>, not to the list.
List FAQ: <http://www.barebones.com/support/lists/bbedit_talk.shtml>
List archives: <http://www.listsearch.com/BBEditTalk.lasso>
To unsubscribe, send mail to: <[EMAIL PROTECTED]>