Reverse Positional Sort

Reverse Positional Sort

lhutton

    Jul 09, 2005#1

    I have the following macro, which allows me to rearrange

    1
    2
    3

    to

    3
    2
    1

    but I would like to be able to rearrange

    1
    2
    3
    4
    5

    to

    543
    21

    Would appreciate an edit to get this working, please. Also, are there any resources available for people wanting to create custom macros for UE or do we have to rely on these forums?

    InsertMode
    ColumnModeOff
    HexOff
    UnixReOn
    Top
    ColumnModeOn
    ColumnInsert " ~"
    Top
    ColumnInsertNum 1 1
    Top
    SortDes Numeric 1 -1 0 0 0 0 0 0
    Top
    Find RegExp "^\d+ +~"
    Replace All ""
    ColumnModeOff

    6,686585
    Grand MasterGrand Master
    6,686585

      May 14, 2006#2

      Sorry for the very late answer. But I looked now into your question and your macro and have seen that you only need a regex replace at the end of your macro. So just add the following commands to your macro and you should get what you want. If your file is not a DOS file and opened without auto conversion to DOS you have to use \n for Unix instead of \p or \r for MAC instead of \p.

      Find RegExp "^(.*)\p(.*)\p(.*)\p(.*)\p(.*)$"
      Replace All "\1\2\3\p\4\5"
      Best regards from an UC/UE/UES for Windows user from Austria

      lhutton
      lhutton

        May 15, 2006#3

        Thanks! That works well.