Page 1 of 1

How to reverse text with TextPad?

Posted: Tue May 12, 2009 12:22 pm
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,

Posted: Tue May 12, 2009 2:02 pm
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.