How to reverse text with TextPad?

General questions about using TextPad

Moderators: AmigoJack, bbadmin, helios, MudGuard

Post Reply
kemosabi
Posts: 1
Joined: Tue May 12, 2009 12:13 pm

How to reverse text with TextPad?

Post by kemosabi »

Hi,
I have searched the forums and couldn't find an answer to this.
I was wondering if it is possible to reverse the text in a .txt file using a macro or something else.

For example..
Original text:

hello
how
are
you

After Reversing:

olleh
woh
era
uoy

Thanks in advance,
User avatar
Bob Hansen
Posts: 1516
Joined: Sun Mar 02, 2003 8:15 pm
Location: Salem, NH
Contact:

Post by Bob Hansen »

Try this:

1. Use RegEx to Insert a Return Code (\n) after each character to place each character on its own line.
2. Use Fill Block to have numbers assigned as first character on each line (you will need to be in Block Select Mode and using a Fixed Width font).
3. Sort the lines in descending order
4. Use RegEX to remove the leading numbers and the previous Return Code to bring all characters back onto their original lines.

You may need to do some special planning to take care of any blank lines.

Once you work out the manual steps, then you could record them into a macro, but remember that the macro cannot be edited.
Hope this was helpful.............good luck,
Bob
Post Reply