How to remove duplicate lines in Visual Studio Cod

2020-02-07 14:16发布

Say you have the following text:

abc
123
abc
456
789
abc
abc

I want to remove all "abc" lines and just keep one. I don't mind sorting. The result should be like this:

abc
123
456
789

7条回答
Melony?
2楼-- · 2020-02-07 14:49

Here is a very interesting extension: Transformer

Features:

  • Unique Lines
  • Unique Lines As New Document
  • Filter Lines
  • Filter Lines As New Document
  • Sort Lines
  • Sort Lines By Length
  • Align To Cursor
  • Align CSV
  • Compact CSV
  • Copy To New Document
  • Select Lines
  • Lines As JSON
  • Trim Lines
  • Count Duplicate Lines As New Document
  • Macros

For removing duplicate lines:

  • Removes duplicate lines from the document

  • Operates on selection or current block if no selection

I haven't played with it much besides the "Unique Lines" command but it seems quite nicely done (including attempting a macro recorder!).

查看更多
登录 后发表回答