Questions tagged [sorting]

Sorting is any process of arranging items according to a certain sequence or into different sets.

Filter by
Sorted by
Tagged with
198
votes
18answers
248k views

Unix/Linux find and sort by date modified

How can I do a simple find which would order the results by most recently modified? Here is the current find I am using (I am doing a shell escape in PHP, so that is the reasoning for the variables): ...
16
votes
4answers
13k views

Windows 7, any way to sort folders and files all mixed together?

Is there a way to sort folders and files by their name all mixed together in Windows 7? It would be easier to understand if you look at this page. I want my folders and files arranged like the ...
9
votes
3answers
15k views

Sort order in Windows Explorer

The behaviour described below occurs on Windows-7 systems and on Windows XP. We operate in a dual-language environment - English and Hebrew. When in Windows Explorer we sort files by name, the order ...
2
votes
2answers
12k views

Excel: How to treat multiple lines as one while sorting?

I get a XLS-File as a database report. The File is in the following format: | Customer | Name | ... | Orders 1 | 6 | ... | ... | 1234 2 | | | | 4567 3 | | ...
8
votes
2answers
5k views

How can I disable Windows Vista / 7 Explorer's “auto sort” after file copying?

One of the things that really annoys me in Windows Vista / Windows 7 is the new "auto sort" feature. In Windows XP, whenever you copy a bunch of files to a folder, they are all placed at the end of ...
1
vote
2answers
3k views

Change how Explorer sorts files with number in name

In Windows 7 / Windows Server 2008, if files have only number in filename, Explorer sorts them by the number. How can I change this sort to trully alphabetic, ie.: 108 1110 188 439 455 etc.
271
votes
1answer
280k views

Sorting lines in Notepad++ without the TextFX plugin

The current version of Notepad++ (at the time of this writing) is 6.6.3. Version 6.5.2 is the first that introduced a native (without a plugin) sorting function. At least, that's what they claim; even ...
103
votes
12answers
99k views

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

I would like to use the ls command to first show directories and then files. I tried: ls -la | sort -k 1 But I got a wrong order.
41
votes
7answers
51k views

In bash, how to sort strings with numbers in them?

If I have these files in a directory cwcch10.pdf cwcch11.pdf cwcch12.pdf cwcch13.pdf cwcch14.pdf cwcch15.pdf cwcch16.pdf cwcch17.pdf cwcch18.pdf cwcch1.pdf cwcch2.pdf cwcch3.pdf cwcch4.pdf cwcch5.pdf ...
25
votes
1answer
13k views

Sorting by Date - Very Slow

I'm using Windows 8 RTM. I have about 1,100 files in a folder. When I sort by date (in either direction), The address bar shows the green progress indicator as if it's working hard to perform the sort....
22
votes
1answer
64k views

How to sort an Excel spreadsheet columns by row contents?

How do I sort the columns of an Excel spreadsheet? The Sort command from the Data menu only allows me to sort rows by the value of a column. I want to sort the columns alphabetically by the contents ...
19
votes
4answers
30k views

Sorting Excel column by IP address

I have a fairly large (over 200 row) Excel spreadsheet that lists items in my network (i.e. printers, servers, workstations, network projectors, etc), and one of the first columns is the IP Address ...
7
votes
3answers
9k views

Find all duplicate files by MD5 hash

I'm trying to find all duplicate files (based on MD5 hash) and ordered by file size. So far I have this: find . -type f -print0 | xargs -0 -I "{}" sh -c 'md5sum "{}" | cut -f1 -d " " | tr "\n" " "; ...
3
votes
1answer
8k views

Alternate Row Colors of Duplicate Data in Excel

I am working with a dataset in Excel that contains duplicate values and non-duplicate values that are numbers. I would like each duplicate value group to have alternating shades via Conditional ...
6
votes
1answer
6k views

Excel 2013, can data be re-sorted automatically?

Is there a way to re-sort automatically? I have automatically updating cells and depending on incoming values the rankings change. I am looking for a way to have the table resort automatically (...
5
votes
6answers
7k views

How to reverse a text file on Windows

How do I reverse the contents of a .txt file while preserving empty lines? For example, text one text two text three text four text five text six would become text six text five text four ...
3
votes
2answers
288 views

Sort packs of lines alphabetically

Note: the complementary question is here: How to separately sort lines within multiple “chunks” separated with headers? So what I did find an answer to, is how to sort lines in a text files ...
3
votes
3answers
4k views

How to correctly sort calendar months “mmm” with AutoFilter?

I need to use filter to sort calendar months in mmm format. Data > Sort > Custom will do it but I cannot make filter work. Months are in a column eg SEP, APR, JAN, APR, etc. Filter just does ...
0
votes
1answer
189 views

Use find to delete all images under given dimensions

I just used Recuva and Photorec to recover some data off an accidentally-formatted drive. Naturally, the result is every intact file that ever existed on the drive during its lifetime. This means tens ...
37
votes
8answers
38k views

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

I am currently working with a large list of IP addresses (thousands of them). However, when I sort the column containing the IP addresses, they don't sort in a way that is intuitive or easy to follow....
20
votes
6answers
81k views

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

My file dialog shows files sorted by date and I want it to sort alphabetically by filename.
14
votes
2answers
42k views

How to sort by date modified ascending ALWAYS in Windows?

How to force Windows to sort always by date modified and always ascending? The situation is that often 1) Modified field is Off (not listed in Sort By menu by default) 2) Once opened More menu ...
6
votes
1answer
2k views

Is there a Unicode-aware LC_COLLATE sort order which respects punctuation?

As far as I can tell, setting the environment variable LC_COLLATE=en_US.utf8 changes four things compared to LC_COLLATE=c, regarding how programs like ls will sort files: Unicode characters are ...
7
votes
1answer
3k views

How can I sort a folder in OS X Lion without having to group files as done with “Arrange By”?

I'm sorry to say there are several things I liked better in Snow Leopard. Sorting files in Finder is one of those things. If I "Arrange By" -> "None" it does not group items and it looks like 10.6. I ...
4
votes
1answer
4k views

Windows 10: Sort/rearrange icons in taskbar

I was wondering if there is an option in Windows, a tweak or third party software to allow arranging icons in the taskbar (currently it is possible only to drag a group of the same program, but not an ...
3
votes
1answer
5k views

Outlook 2003: How to group by flag AND sort by date?

I'm trying to get Outlook 2003 to do the following: Group the emails in my Inbox by FLAG and then sort by DATE. This SHOULD be accomplished by the following settings: It seems to work, as I get ...
12
votes
3answers
29k views

Alphanumeric sorting in Excel

In Excel, is it possible to sort alphanumerics from a-1, a-2, a-3...a-123 instead of a-1, a-10, a-100, a-11? Sorting via oldest to newest or via A-Z, definitely won't give me the result I want. I've ...
11
votes
2answers
4k views

Sorting mail in Thunderbird by both unread status and by date

Is there any way to make Thunderbird sort mail so that unread mail is always at the top and the e-mails are sorted by date in descending order persistently? Maybe an add-on that someone can recommend? ...
5
votes
2answers
22k views

batch - File last modification time with seconds

I want to know when a file has been modified for the last time. I can get these infos using the following batch script: FOR %%i IN (myfile) DO SET modif_time=%%~ti The problem is that I need the ...
5
votes
4answers
4k views

Windows explorer: sort by date modified

Is it possible to properly view the contents of a folder sorted by modification date in Windows explorer (Windows 7)? I can sort by the date modified column, but folders and files are seperated. I ...
5
votes
3answers
5k views

remove duplicate lines without sorting

Is it possible to remove duplicated rows in Notepad++, leaving only a single occurrence of a line? If I have these lines: 1 5 3 9 1 4 3 I want it to be: 1 5 3 9 4 I want it to keep first ...
5
votes
1answer
1k views

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

I've noticed that in Windows, when you sort files alphabetically, there's a strange thing that happens when you have file names that extend one another with spaces. For example, say you have two files,...
3
votes
4answers
2k views

How to sort Spotlight results by size in the Finder?

How do I sort search result by size in Finder? I would prefer some sort of setting, or shell plug-in. I'm using this to clean my hard drive by finding and deleting the largest files first. I'm not ...
3
votes
0answers
218 views

Sort mails by 3 criteria on Thunderbird

I would like to sort my mails by 3 criteria, on this order : Date (new mails up the list) Read state (unread messages upper) "Starred" (starred messages at the uppest) But it seems that it is ...
2
votes
4answers
8k views

Sorting files (images) and then renaming them automatically according to the sort

We want to sort image files in a directory and want them to renamed according to the order we gave. Is there a tool that can do this? (os: windows xp)
2
votes
1answer
6k views

specify the sort order in “copy /b *.dat foo” in Windows cmd

Normally, when I do a copy /b *.data foo in Windows cmd, the *.data files are catenated in the sorted order into the destination file foo. This matches my desired behavior. However, I just met a ...
2
votes
1answer
3k views

What Windows app can sort a huge XML file?

I have some enormous XML-based configuration files, with 125000 lines in them. The problem is that they are auto-generated by the system I use, and "child" tags are in a random order within their ...
1
vote
1answer
4k views

How to sort folders by last characters of folder name in Windows 7?

I have a stack of client folders with names like this: eastcoal 008 mee 022 orr 047 owaka 032 owen 025 powernet006 redpath 031 Normally this works, but sometimes I'd like to sort by the number. ...
4
votes
2answers
2k views

How do I randomly sort groups of multiple lines in a multi-GB file?

I've got a multi-GB file that has elements in 4 lines, and I would like to have every 4 lines randomized in another file, this is, keeping each four lines grouped and randomize those sets. Is there an ...
4
votes
4answers
59k views

How do I line up two sets of data in Excel?

If I've got two sets of data, how can I line them up in Excel 2007? For example, if one set of data has Position Occurrences 8 3 11 1 17 ...
3
votes
2answers
7k views

sort numbers and numbers+text together in Excel

I am trying to sort an Excel sheet based on a column that has a mix of: 3 digit numbers (such as 404) 3 digit numbers with non-numeric characters appended (such as 802b) non-numeric text (such as ...
3
votes
2answers
1k views

How to reorder folders? (as displayed in `ls -U`)

I've got a number of unordered folders on a memory stick, which my car stereo shows in order of their real position on the stick (i.e. same as ls -U) What's the easiest way of physically reordering ...
3
votes
2answers
1k views

How do I reorder sheets in specific order, then alphabetically?

I need to reorder my sheets in a specific order, then if there are any left, do it alphabetically. I have the macro below to reorder them alphabetically. If i have sheets ""METALS", "SVOC", "GENCHEM"...
2
votes
1answer
349 views

How to separately sort lines within multiple “chunks” separated with headers?

This question is complementary to this one: Sort packs of lines alphabetically. After answering there, it turned out I had totally misunderstood the question and solved another problem. Not wanting my ...
2
votes
1answer
328 views

Why is sort -k5nr not a syntax error?

$ ls -l | sort -k 5 -n -r $ ls -l | sort -k5nr I find out these two command generate the same output. But I don't understand why I can combine 5 with n? Why not a syntax error? edit: $ ls -l | cut -...
2
votes
1answer
215 views

Can not change default explorer sorting option

Like the title says: I am not able to change the default sorting option in windows explorer. At the moment folders and files are sorted by date modified, but I'd like to change this to sorted by name. ...
2
votes
1answer
5k views

Excel Spreadsheet Not Sorting

In my excel spreadsheet, I am trying to randomly sort a large list. I am doing this by adding in a new column to my table. This table is assigned a random integer between 1 and 10. This is done by =...
2
votes
1answer
456 views

Lining up sets of data in Excel (both with unique keys)

A related question asks how to line up two sets of data in Excel. I am struggling to figure out how to do this when you have values in both lists which don't exist in the other list. Ie: how would ...
1
vote
1answer
1k views

Microsoft Excel 2003 - Merge by Column

I'm trying to merge two excel files, here is the structure of the files: [A] [B] I want to add the column B from one file to another as column C, but the thing is that they have some rows under A ...
1
vote
1answer
2k views

Automatic sort for excel worksheet

I want to create a to-do list in Excel that automatically sorts the to-do entries in a list, in order of ones to do first (closest deadlines). I would also like a section that shows the tasks for ...