The tag has no wiki summary.

learn more… | top users | synonyms

0
votes
2answers
35 views

Take the value of another column if the query column is between two column values

So i have a file with column that has information on salary (eg. 2674 dollars) - indi salary sam 2674 john 6375 max 9547 and another file with the scale of the salary ...
3
votes
1answer
46 views

How to find out the biggest number in many documents that contains different numbers

For example, there are some temperature data at those folders in different time. temps.txt contains the temperature number. So how can I use bash script to find out the maximum temperature? (the ...
1
vote
1answer
84 views

Summing by common strings in different files

I have a file file1 with the amount of times a user shows up in the files, something like this: 4 userC 2 userA 1 userB and I have another file file2 with users and other info like: userC, degree2 ...
2
votes
3answers
113 views

How to sum times in a text file using command-line?

I have a text file containing flight times, hours and minutes separated by colon sign, one per line: 00:50 00:41 00:43 00:50 01:24 I am currently using Apple's Numbers application with a simple ...
1
vote
1answer
39 views

Numeric sort by the column values

For example I have some test file and want to sort it by the column values. After awk -F'[:,]' '{print $16}' test.json I get next output for the column 16: 123 457 68 11 939 11 345 9 199 ...
3
votes
2answers
283 views

Thousands separator in printf in zsh

I have been trying to define a thousands separator in printf for a while now and I have discovered that zsh has some problems with it. In bash I can use something like: $ printf "%'d\n" 1234567890 ...
3
votes
4answers
2k views

Grouped aggregate utility (like SQL GROUP BY)?

Unix has several utilities for performing relational algebra-like operations on streams (grep, join, cut, additional things with awk). Is there a grouped aggregate utility readily available (or ...
6
votes
1answer
1k views

comm: file is not in sorted order

I used comm to compare two sorted files. Each line in these files are positive integer numbers. But the results show comm: file 1 is not in sorted order comm: file 2 is not in sorted order How ...
3
votes
3answers
154 views

Print only lines that are completely numeric

I'd like to filter through a text file and only print the lines where each column is a valid floating point number. For example: 3 6 2 -4.2 21.2 3 x 4.2 21.2 3 2 2.2.2 Only the first line would ...