Sorting FQDN.

Sorting FQDN.

1

    Sep 21, 2006#1

    I am trying to sort a list of FQDN [ Wikipedia FQDN ]

    Example:

    www.ultraedit.com.
    idm.com.
    www.idm.ultraedit.com.
    www.idm.com.

    would be sorted to

    idm.com.
    www.idm.com.
    www.ultraedit.com.
    www.idm.ultraedit.com.

    6,686585
    Grand MasterGrand Master
    6,686585

      Sep 21, 2006#2

      The following macro sorts your example (copied into an ASCII file) as you want it. Hopefully it works for your whole list. The macro property Continue if a Find with Replace not found must be checked for this macro.

      InsertMode
      ColumnModeOff
      HexOff
      UnixReOff
      Bottom
      IfColNum 1
      Else
      "
      "
      EndIf
      Top
      Find RegExp "%^([~.^r^n]+.[~.^r^n]+.^)^([~.^r^n]+.^)^(?*^)$"
      Replace All "^2^3»^1"
      Find RegExp "%^([~.^r^n]+.^)^([~.^r^n]+.^)^([~»^r^n]+^)$"
      Replace All "^2^3»^1"
      SortAsc IgnoreCase 1 -1 0 0 0 0 0 0
      Find RegExp "%^([~»^r^n]+^)»^(*^)$"
      Replace All "^2^1"

      Add UnixReOn or PerlReOn (v12+ of UE) at the end of the macro if you do not use UltraEdit style regular expressions by default - see search configuration. Macro command UnixReOff sets the regular expression option to UltraEdit style.
      Best regards from an UC/UE/UES for Windows user from Austria