The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My badges

  • Twitter Updates

  • My Flickr Stream

  • Pages

  • All categories

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 1,640 other followers

sorting – Is there a Windows equivalent to the Unix uniq? – Super User

Posted by jpluimers on 2019/03/08

TL;DR:

  • Windows 10 has an undocumented /unique switch for sort
  • git for Windows ships with uniq (in a default x64 install, it is at C:\Program Files\Git\usr\bin\uniq.exe)

From [WayBack] sorting – Is there a Windows equivalent to the Unix uniq? – Super User

This works fine:

dir /s /b *0*.pas *1*.pas *2*.pas *3*.pas *4*.pas *5*.pas *6*.pas *7*.pas*8*.pas *9*.pas | sort /unique > pas-files-with-numeric-names.txt

I need remove duplicate lines from a text file, it is simple in Linux usingcat file.txt |sort | uniqwhen file.txt containsaaabbbaaacccIt will output aaabbbcccIs there a Windows

 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

 
%d bloggers like this: