I need to sort a filename pair sorted by time. Every file starts with AUSZUG or UMSATZ (and some numbers after). But the problem is that I cannot sort it by just time because some files can be uploaded (created) not as pair. For example, default sort: You can see, UMSATZ pair for AUSZUG_5785745789.TXT.GPG are in last line I can
Tag: sorting
How to find newest files with a certain name?
Suppose I have a directory with many files of the same name in subdirectories (for example, comes up when keeping BibTeX files for multiple academic papers). What’s the best way to find the newest version of a file with a given name? I’ve come up with the following command which lists all the files named someFile along with their dates,
Shuffling a large text file without/with group order maintained
Instead of making a script, it there a one liner to shuffle a large tab separated text file, based on the unique elements in the first column. That means, for each unique element in the first column, number of rows will be equal and be specified by the user. There are two output possibilities, maintaining the row order or randomized
Does the Linux implementation of quicksort “back off” to insertion sort?
I was reading in Bentley & McIlroy (1993) that their suggested implementation of Quicksort uses Insertion Sort when the arrays get small enough. I was curious to know whether modern-day kernels use this same maneuver. Does anyone know whether the Linux kernel, for instance, switches from Quicksort to Insertion Sort in this way? Answer Assuming you mean the qsort from
Sort files numerically in bash
I need to sort .flv files numerically and i was able to do it with the following command: but with many files(hundreds) it’s not sorting correctly. but the strange this is, if i’m ruining the command without “*.flv” it’s working. i could use just ls but i have other file types in the folder. what i’ve tried so far: Answer
Sorting a tab delimited file
I have a data with the following format: Now I tried to sort the file based on the last field decreasingly. I tried the following commands but it wasn’t sorted as we expected. What’s the right way to do it? Here is the sample data. Answer Using bash, this will do the trick: Notice the dollar sign in front of