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 ...
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 ...
41
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 ...
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 ...
18
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 {} +
17
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 ...
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 ...
14
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 (...
13
votes
Windows Explorer sorting order for special characters?
The answers provided in this discussion, while interesting, are somewhat esoteric. The simple answer is that none of the symbols are sorted after the letters (not taking into account the special way ' ...
13
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 ...
11
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)
...
10
votes
Accepted
How to sort alphabetically based on a particular column in notepad++?
Place the cursor before the first character of the desired column.
Press and hold the ALT key.
By using the mouse mark the block in the column you want to sort like shown in the screenshot below.
From ...
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) ...
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 ...
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 ...
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/...
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
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 &...
7
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 ...
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 ...
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 ...
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
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
...
5
votes
Excel Sort Numeric Column By Number
I know this is an old post, but since it's at the top of the search results for this kind of thing...
There's a much easier way to do this. To convert numbers stored as text to numbers:
Select the ...
5
votes
Sorting mail in Thunderbird by both unread status and by date
Click the settings button while looking at your inbox (the 3 hatch marks upper right on your inbox view) point to "view" then "sort by" choose "read". If necessary go in again and choose sort order "...
5
votes
Accepted
Unix vs Excel sort
env LC_ALL=C sort
From the man page of sort:
*** WARNING *** The locale specified by the environment affects sort
order. Set LC_ALL=C to get the traditional sort order that uses native
...
5
votes
Accepted
Cannot sort Excel Pivot Table by two or more columns
Use a calculated field
The best way I've found to achieve this is to add a calculated field to the table that produces the correct sort order, and then to hide that column.
The sort order field ...
5
votes
bash sort from the end of string
I wanted to sort (group) a list of email addresses by their domain names e.g. all '@xxx.com' then all the '@yyy.com' (solution based on a comment by makgun)
rev emailist | sort | rev > ...
5
votes
Accepted
Bash - sort by not first character
tl;dr
sort -k1.5 file | uniq -s 6 -w 5
Explanation
My sort is GNU coreutils 8.22. The manpage for my sort shows:
KEYDEF is F[.C][OPTS][,F[.C][OPTS]] for start and stop position, where F is a field ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
sorting × 716microsoft-excel × 240
linux × 79
windows × 59
windows-explorer × 59
bash × 55
windows-10 × 45
windows-7 × 39
worksheet-function × 39
unix × 39
microsoft-excel-2010 × 38
command-line × 30
microsoft-excel-2007 × 19
email × 16
vba × 16
date × 15
macos × 14
spreadsheet × 14
filenames × 14
microsoft-outlook × 13
notepad++ × 13
microsoft-excel-2016 × 13
pivot-table × 13
powershell × 12
shell × 12