Macros/Macro Creation/"Text Editing" a created mac

General questions about using TextPad

Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard

Post Reply
Geoffrey Kidd

Macros/Macro Creation/"Text Editing" a created mac

Post by Geoffrey Kidd »

I want to create an HTML-character->International Character
macro which will go through a file and systematically
replace "Ü" with "Ü", and so forth for EVERY international
character in the standard HTML set. None of the macros in the
downloads section at textpad.com seems to do this, at least,
judging from the descriptions.

However, the ONLY way I know to create such a macro is to
systematically record the "Replace" for each character, and
that's a lot of characters. Also, make one little mistake and
it's start over from the beginning time.

Any way to create a macro just by entering commands such as
c/Ü/Ü/, the way I do in the SQL editor I use at work?

Thanks.
Jeff Epstein

Re: Macros/Macro Creation/"Text Editing" a created

Post by Jeff Epstein »

This is truly one of the biggest problems that arise with uneditable macros. I might recommend using another program, or even writing your own. Perl, Java, ...?

Does anyone know of existing programs (either coded by you, or commercial software) that can approach this type of problem?

:' (
Jeff
http://www.jeffyjeffy.com/textpad
Roy Beatty

Re: Macros/Macro Creation/"Text Editing" a created

Post by Roy Beatty »

For HTML related functions, evaluate NoteTab Pro -- http://www.notetab.com.

I own full licenses to both. Aside from HTML-specific functions, TextPad is more robust, has a clearer user interface, and is the editor I use far more often. As I said to Jeff over lunch at the first TextPad Fan Club meeting, Textpad gives me a better understanding of how an object-oriented UI *should* behave.

What higher compliment can I pay?

Roy Beatty
Jeff Epstein

Re: Macros/Macro Creation/"Text Editing" a created

Post by Jeff Epstein »

Here here :')
Jacob Carpenter

Re: Macros/Macro Creation/"Text Editing" a created

Post by Jacob Carpenter »

Well, as mentioned, Perl is a beautiful way to process text. In fact, if you want to convert all the hi-ascii numeric entities to their equivalent characters you simply need to:

perl -pe "s{&#([192-255]+);}{print chr($1);''}ge" <filename>

Obviously it gets a little more complex with real HTML character entities (I smell a hash).

hope this is helpful/enjoyable to some,
Jacob.
Roy Beatty

Re: Macros/Macro Creation/"Text Editing" a created

Post by Roy Beatty »

Boy, I love those one-liners!
Jacob Carpenter

Re: Macros/Macro Creation/"Text Editing" a created

Post by Jacob Carpenter »

Dohh; let me ammend my code:

perl -pe "s/&#(\d+);/chr $1/eg" <filename>

I don't know where that pseudo-character class came from.

P.S. this catches all the &# type entities ...
Post Reply