Sorting text files or other data, for example with the sort utility.

learn more… | top users | synonyms

0
votes
3answers
79 views

How to list all files *.html bigger than {size} excluding some {*parts*}

I need a command to list files. But I have three problems: I want files ending with .HTML and .HTM If any file has parts like: google docs or form in the name, I want to exclude it. I want just ...
1
vote
2answers
115 views

Compare and print data from different text files to one in Shell

How can I compare and print data from different text files to one in Shell. I have captures NAS details of three different boxes using SSH, now I need to combine all the three text files to one file ...
4
votes
1answer
52 views

What is the sort order when using conditional operators?

I wrote a bash script that processes a list of filenames (using glob expansion, as in for f in *) and then outputs a subset of this list to a file. Subsequently I read the content of this file into an ...
2
votes
1answer
51 views

POSIX Awk sort array

I would like to sort an array with POSIX Awk, however I have discovered that: asort() asorti() PROCINFO["sorted_in"] are all GNU extensions. Can this be done with without GNU Awk?
2
votes
1answer
181 views

Installed coreutils on CentOS for sort --human-readable flag but it still doesn't work

I'm trying to do du -h | sort -h, but my CentOS 5.7 doesn't have -h flag for sort. So I installed coreutils Updated: coreutils.x86_64 0:5.97-34.el5_8.1 Complete! yet sort still doesn't have ...
1
vote
1answer
27 views

Using Perl for Even/Odd numbers

Currently, I'm using a process to create a very specific set of four files. The Process I'm using is shown in the attached Process Image, below: The first line is part of a solution, given to a ...
1
vote
1answer
277 views

sort file based one colum and group by another column

I have a file of three columns: 1 A 0.5 2 B 0.7 3 A 10 4 C 4 5 B 4 I want to sort the file by increasing order of column 3 and group by column 2 1 A 0.5 3 A 10 ...
1
vote
1answer
50 views

Different results OS X/Linux with “find PATH -mount \( -type f -o -type d \) -print0 | LC_ALL=C sort --zero-terminated > OUTPUT.txt”

this command is part of a script I use for comparing files: find test/ -mount \( -type f -o -type d \) -print0 \ | LC_ALL=C sort --zero-terminated > OUTPUT.txt // test/ is the PATH ...
0
votes
1answer
71 views

sort files twice

I have a series of 300+ files that I need to sort twice, once by the date and a second time within that date by part of the filename. The only standard in the names is that ends with *mmddyyyy<time ...
0
votes
1answer
61 views

bash: How to determine the largest number (newest version) from: ls *.tar.gz | cut -c 2-4

Hi I'm trying to get the largest number (newest version) of a file, I got a bunch of tar.gz files in a directory, versions of some software in the format v${version_number}_software.tar.gz, where ...
0
votes
1answer
56 views

How do I sort a file and output the latest record in case duplicates exist?

I save all the requests, received via API, in a file. I wish to process only the latest request if duplicate requests arrive. Sort command is not helping, I am using : sort -r -k 1.69,1.88 ...
0
votes
1answer
36 views

Keeping first instance of duplicates when column values are interchangeable

I have previously asked a question about keeping the first instance of duplicates and the solution provided has been working perfectly until now (see Keeping first instance of duplicates). However, I ...
0
votes
1answer
119 views

direct GNU sort to use much memory and many cores

I have a fairly large text file (19Gb, half a billion lines) and a fairly large server on which to sort it (16 cores, 64Gb memory) running Ubuntu 12.04. What is the best way to use the command line ...
-1
votes
1answer
98 views

How to sort by column and break ties randomly

I have a tab-delimited file with three columns like this: joe W 4 bob A 1 ana F 1 roy J 3 sam S 0 don R 2 tim L 0 cyb M 0 I want to sort this file by decreasing values in the third column, but to ...
1
vote
0answers
49 views

Removing duplicates in a large text list

I've searched around the internet and stackexchange for this. Even though there are lots of similar topics, I haven't found a solution yet. So, I have a quite large list (approx. 20GB), which ...
1
vote
0answers
21 views

sort behavior when using numerical option: “sort -k2,2 -nk6,6 foo” vs “sort -k2,2 -k6,6n foo”

The two examples in the title produce very different results. The first (sort -k2,2 -nk6,6 foo) brings back the following results: 153759 townhome 900 2 1 79000 876543 townhome 745 2 1 79000 222999 ...
1
vote
0answers
133 views

Sorted HTML table

I need a very quick and easy way to sort HTML tables. The table rows contain images that should stay with their appropriate row. I tried pasting my HTML into Libre Office calc, but the images are not ...
1
vote
0answers
68 views

Characters not defined into iso14651_t1_pinyin are not sorted properly

when I try to sort characters not defined in iso14651_t1_pinyin, no sort happens, they are simply left in place. I would expect to see them sorted according to their codepoint. Is there a way I can ...
0
votes
0answers
50 views

How to find 100 GB of most recently modified files and send to rsync for local synchronization

I need to select 100gig of most recently changed files from a local directory and do an rsync to a local directory (skipping files that are already rsynced). If I try something like find . -mtime ...
0
votes
0answers
81 views

Join, file is not sorted

I have two files whose first lines are File1 Locus_1174 [six columns of numbers] locus_6396 [six columns of numbers] Locus_12135 [six columns of numbers] locus_13689 [six columns of ...
0
votes
0answers
28 views

Sorting different groups (separated by a line) based on 16th column

I have a CSV file which is in this format cluster 0 aaa bbb ccc ....... xxx yyy zzz bhc adf ghy ....... hjn dft cbn cluster 1 adg bhg klo ....... jio jik mkl asf ghb nbv ....... cvb xcz hga ... ...
0
votes
0answers
125 views

Archlinux: Gnome 3.16 - ls & nautilus incorrect sorting

Recently switched from Xfce 4.12 DE to Gnome 3.16 and I have a problem with dirs & files sorting in terminal and nautilus. Test directories (how it should be): [ Pqr ] Abc Klm My current order ...