Hot answers tagged

79 votes
Accepted

Case insensitive sorting

Vim's own :sort command :%sort i does what you want. See :help :sort. Alternatively, you can also use your system's sort command as a filter: :%!sort -f See :help filter in Vim and $ man sort in ...
  • 21.8k
53 votes

Why does the `ls` command sort files like this?

It depends on the collation order of your locale: >LANG=en_IE.UTF-8 ls -1 foo* foopa.png foo.png fooqa.png >LANG=C ls -1 foo* foo.png foopa.png fooqa.png You can also use the LC_COLLATE ...
  • 9,418
42 votes
Accepted

How do I get cells in Excel that contain IP addresses to sort properly?

As you may have realised, your IP addresses are treated as text and not numbers. They are being sorted as text, which means that addresses beginning with "162" will come before addresses beginning ...
  • 3,082
38 votes
Accepted

Is there a Windows equivalent to the Unix uniq?

The Sort-Object cmdlet in PowerShell supports a -Unique switch that does the same thing as uniq: Get-Content file.txt | Sort-Object -unique Of course, owing to presence of aliases in PowerShell, you ...
  • 663
33 votes
Accepted

Sort --parallel isn't parallelizing

sort doesn't create a thread unless it needs to, and for small files it's just too much overhead. Now unfortunately sort treats a pipe like a small file. If you want to feed enough data to 24 threads ...
  • 1,160
23 votes

Sort the contents of an extremely large (800GB) text file on Windows

One other option is to load the file into a Database. E.g. MySQL and MySQL Workbench. Databases are perfect candidates for working with large files. If your input file contains just words separated by ...
  • 331
19 votes

Windows Explorer sorting order for special characters?

I did some testing and the overall ordering seems to be as follows... Symbols Latin (ordered by Unicode value (U+xxxx)) Greek (ordered by Unicode value (U+xxxx)) Cyrillic (ordered by Unicode value (U+...
  • 1,809
17 votes

Sort by multiple columns in Windows Explorer 8

You can sort on multiple columns by shift-clicking. A normal click sets the primary order, shown by the up/down indicator arrow. After that, you can press Shift while clicking on a column header to ...
  • 4,034
16 votes
Accepted

Sort the contents of an extremely large (800GB) text file on Windows

What are my options? Try Freeware Command Line Sort Utility CMSort. It uses multiple temporary files and then merges them at the end. CMsort is reading records of an input file until the adjusted ...
  • 145k
15 votes

How do I change the default sort order on Windows Explorer and the File Dialogs

I was still getting inconsistent results with the various solutions. This seemed to work best for me: Open My Documents folder, Select View - Details Either (A) move Date column to the far left or (...
  • 161
13 votes

Unix/Linux find and sort by date modified

I have a simple solution that works for both FreeBSD (OS X) and Linux: find . -type f -exec ls -t {} +
13 votes
Accepted

Windows 10: Sort/rearrange icons in taskbar

I'm on Windows 10 Pro 1903. 7+ Taskbar Tweaker can be downloaded from its website. I've download version 5.7.0.4 Beta and it runs fine. The option was disabled by default for me. I did not find any ...
10 votes

Sorting Excel column by IP address

I realize this is an old post, but in the interest of providing a working solution, I present the following. Just put this formula in an adjacent cell and update the references to point to the cell ...
10 votes

Windows Explorer sorting order for special characters?

The answers provided in this discussion, while interesting are somewhat cerebral and quite esoteric. The simple answer to the original poster's question is: none of the symbols are sorted after the ...
  • 101
10 votes
Accepted

How to sort by date modified ascending ALWAYS in Windows?

Instructions Press + E to open File Explorer, and then click onto the root of the "C" drive Press Ctrl + Shift + 6 to change the root "C" drive folder view to Details view which will ...
10 votes

How do I get cells in Excel that contain IP addresses to sort properly?

The most easiest, 3 steps Solution I can suggest you are,,, Select the IP Address Column, apply Text to Column command. In adjacent Column write this Formula =CONCATENATE(B3,".",C3,".",D3,".",E3) ...
  • 8,761
9 votes

How do I get cells in Excel that contain IP addresses to sort properly?

Here'a a VBA function I wrote some time ago to solve the same problem. It generates a padded version of an IPv4 address which sorts correctly. Function SortAddress(Address As String) ...
  • 206
8 votes

How to sort first directories then files etc… when using “ls” in Unix

There are certain things I want to see in a directory listing, and so far none of the answers here meets all of the requirements below. My requirements for a directory listing: Directories and files ...
  • 737
8 votes

Equivalent of gnu `sort -R` on OSX?

On OS X, if you don't want to install homebrew (but you really should), you could use perl or ruby: perl -MList::Util -e 'print List::Util::shuffle <>' or ruby -e 'puts STDIN.readlines....
  • 3,066
8 votes
Accepted

Alternate Row Colors of Duplicate Data in Excel

Set B2 to =IF(A2=A3, 1, -2) and set B3 to =IF($A2=$A3, B2, IF($A3=$A4, IF(B2>0,3-B2,B2+3), IF(B2>0,-B2,B2))) and drag it down to B30 (or the last row that contains data, whatever that is).  ...
8 votes

How do I get cells in Excel that contain IP addresses to sort properly?

Here is an answer that will take only 1 column of your table and converts the IPv4 address to base 10 numbering. Since you are putting your data in column "M", this starts in cell M2 (M1 being the ...
  • 298
8 votes

Windows alphabetical file sorting: why do spaces have special treatment?

Operating systems can really only use one of two basic methods, ASCII sorting or Natural sorting ASCII gives this pic credit - http://support.ecisolutions.com/doc-ddms/help/reportsmenu/...
  • 41.2k
8 votes
Accepted

In which order does Windows Explorer sort folders when sorting the results of the search by size?

Actually, the primary sort in the "Top Results" view ( the default ) of most SearchResults folders is a property hidden from dislpay: System.Search.Rank. This can be verified by examining ...
  • 7,259
7 votes

Unix/Linux find and sort by date modified

OS X variant of @user195696's answer: With timestamp: find . -type f -exec stat -f "%Sm %N" -t "%Y%y%m%d%H%M" {} \; | sort -r Without timestamp: find . -type f -exec stat -f &...
  • 171
7 votes

Sort the contents of an extremely large (800GB) text file on Windows

sort There are many algorithms used to sort ordered and not ordered files [1]. Since all those algorithms are already implemented, pick a program already tested. In coreutils (from Linux but ...
  • 18.1k
6 votes
Accepted

Firefox sort history based on time

I want to sort only on time and date You can sort using "View" > "By Last Visited". The “last visited” option is similar to the default “by date” option except this too is just a long list with ...
  • 145k
6 votes

Is there a Windows equivalent to the Unix uniq?

There's ports of uniq that work identically to the gnu/coreutils versions. I personally use the variation from GOW but git for windows has a significantly newer version. No cygwin required though for ...
  • 125k
6 votes
Accepted

Sorting fomulas in an Excel table

It looks like your Col G (Height) has a formula that is dependent on either the row values above or below the current row (my guess). This would cause them G to recalc every time there is a sorting ...
6 votes

Sort chemical elements such as H, He, Li, Be by atomic number in Excel

Sort the data by the atomic number. Here's a query to return some data from Wikipedia: let Source = Web.Page(Web.Contents("https://en.wikipedia.org/wiki/List_of_elements_by_atomic_properties&...
  • 5,985
5 votes

Why does 'sort' ignore special characters, like the asterisk?

To provide a simple answer based on others' comments, that doesn't change your environment: input_program | LC_COLLATE=C sort | output_program or LC_COLLATE=C sort < input_file > output_file ...
  • 375

Only top scored, non community-wiki answers of a minimum length are eligible