Loading ...
Sorry, an error occurred while loading the content.

23978Re: [Clip] Deleting duplicate lines

Expand Messages
  • flo.gehrke
    Aug 31 4:49 AM
    • 0 Attachment
      --- In ntb-clips@yahoogroups.com, hsavage <hsavage@...> wrote:
      >
      > (...) you can eliminate the dupes by loading into NTP and
      > sorting. This, of course will sort all records in the database
      > alphabetically, either ascending or descending.

      Harvey,

      In order to avoid the sorting you could try...

      ^!Set %Nr%=0
      :Loop
      ^!Inc %Nr%
      ^!If ^%Nr% > ^$GetTextLineCount$ End
      ^!Jump ^%Nr%
      ^!Set %Line%=^$GetParagraph$
      ^!Replace "^P"^%Line%"" >> "" AS
      ^!Goto Loop

      In a CSV file like...

      "A";"B";"C"
      "D";"E";"F"
      "G";"H";"I"
      "A";"B";"C"
      "A";"B";"C"
      "J";"K";"L"

      the clip will remove line #4 and #5 (duplicates of line #1) without sorting.

      Note: You possibly have to adapt the search pattern to a different data structure.

      Regards,
      Flo
    • Show all 11 messages in this topic