Delete records that have duplicate text strings

Delete records that have duplicate text strings

1

    Jun 28, 2005#1

    UltraEdit/UltraCompare question.....

    I know how to sort the following text file using specific columns, however, I need your help in deleting entire records anytime matches are found when examining specified columns (columns 1-11 in example). For example, after some unknown procedure is complete, I would like to just have the one record (Kelly Smith) left.


    -----------sample file -------------
    Eddie Smith
    Eddie Smith likes soda
    Kelly Smith likes crackers
    Mikie Smith
    Mikie Smith likes food
    Steve Smith
    Steve Smith likes cola

    6,683583
    Grand MasterGrand Master
    6,683583

      Sep 24, 2005#2

      Maybe 3 months too late, but I think, I have now understand what you want. Here is a macro which does the job. But there is one restriction for this solution: The first 11 characters of all lines must have non of the characters, which are special characters for a regular expression in UltraEdit style. This condition is true for your example.

      InsertMode
      ColumnModeOff
      HexOff
      UnixReOff
      Bottom
      IfColNum 1
      Else
      "
      "
      EndIf
      Top
      Clipboard 9
      Loop
      Find RegExp "%???????????"
      IfNotFound
      ExitLoop
      EndIf
      StartSelect
      Copy
      EndSelect
      Key HOME
      ToggleBookmark
      Key DOWN ARROW
      Find RegExp "%^c"
      IfFound
      GotoBookMark
      ToggleBookmark
      Find RegExp "%^c*^p"
      Replace All ""
      Else
      GotoBookMark
      ToggleBookmark
      Key DOWN ARROW
      EndIf
      EndLoop
      ClearClipboard
      Clipboard 0
      UnixReOn

      Remove the last red command, if you use regular expression in UltraEdit style by default instead of Unix style - see Advanced - Configuration - Find - Unix style Regular Expressions. UnixReOn/UnixReOff modifies this setting.
      Best regards from an UC/UE/UES for Windows user from Austria