Skip to main content

All Questions

Tagged with
5 votes
5 answers
377 views

Is it possible to sort the letters in a word in a line of text?

So I have a file full of test commands that I like to run against some of my functions to make sure they are handling all possible situations correctly. No point in having duplicate commands tho. ...
Ray Andrews's user avatar
  • 2,607
6 votes
3 answers
931 views

awk: sort by first column then second; output unique 1st column once but all 2nd column

I have a two-column file that you can create as follows cat > twocol << EOF 007 03 001 03 003 01 137 12 001 11 002 01 002 02 002 03 001 02 002 04 137 94 010 21 001 01 EOF The resultant file, ...
bballdave025's user avatar
1 vote
4 answers
72 views

Reverse sorting of 2 textblocks in larger set of textblocks

I have a list of data, separated into blocks by headlines. The headlines are marked by 6 '=' signs at beginning and end. There is a limited set of headlines that may appear, but not all of them appear ...
Knuschberkeks's user avatar
4 votes
4 answers
393 views

Awk- Compare Numbers from Two Files and write Differences in New File

I have two lists with item numbers and want to mark the difference between these lists by writing the numbers wich aren't in both files in a new file. Both Files have the item number in column 2 and ...
user avatar
0 votes
3 answers
199 views

How can I sort the lines in this text file?

I have a text file with book name and chapter in the bible. I would like to sort the lines so that lines are first sorted according to the order between their books, the lexical order between the ...
Tim's user avatar
  • 106k
6 votes
6 answers
5k views

sort the whole .csv based on the value in a certain column

I have a csv file with different revenues. I want to sort the csv file on revenue from high to low value. I can't find how to do this in terminal without the use of python. I don't want to use python. ...
pwrsheller's user avatar
4 votes
4 answers
438 views

Collect chars from strings and print their unicode

Context (skip, if you don't care; read, if you suspect I'm totally on the wrong track) For an embedded system with small memory, I want to generate fonts which contain only those glyphs actually ...
Philippos's user avatar
  • 13.7k
0 votes
2 answers
1k views

Commands runs in shell, but not in script: no directory found error

I have a few commands that don't run as a script. It's supposed to create a bulleted list of the file names, then sort the columns of each file alphabetically, grab the second and its matching third ...
pierogie's user avatar
4 votes
2 answers
602 views

Sort by column group and ignore other columns failing for this example, why?

I cannot work out why sort is not working correctly for this, but it's sorting based on columns I'm telling it not to. I want to sort with priorities first by column 3, then column 4, then column 5, ...
Giles's user avatar
  • 897
4 votes
2 answers
598 views

How to sort text file lines in ASCII order?

Let's say I have the following file.txt: foo-a baz foo bar foo-c baz If I run sort file.txt, I get the same output: foo-a baz foo bar foo-c baz Since (space) is before - in ASCII, I expected the ...
Thomas Leplus's user avatar
0 votes
1 answer
291 views

Trouble creating for loop with multiple commands to read csv files

I'm trying to create a for loop that reads prints the file name, alphabetizes fields, and adds html tags that would ultimately create an html file that looks like <h3 id= filename> file </h3&...
pierogie's user avatar
0 votes
2 answers
591 views

Compare files with similar names by size between folders

I have two folders with thousands of files each. One folder from last year with a letter and the year prefix for each file (a2020abc123.txt), and the same file for this year in another folder with the ...
corazooooon's user avatar
1 vote
0 answers
1k views

The total size of the argument list and exported variables exceeds the OS limit of 1MB

I was doing a grid search for some scientific computing project, and got a bunch of log files with parameters embedded in the filenames. $ ls -l | wc -l 38210 $ ls -l | tail -rw-rw-r-- 1 qys ...
nalzok's user avatar
  • 431
-2 votes
3 answers
61 views

cert expired report per date

Hi How can i sort below file so as to have cert expiration date is used to sort this, thanks Cluster10* expire date: Feb 22 23:59:59 2024 GMT Cluster11* expire date: Feb 1 23:59:59 2023 GMT ...
Kiran Kumar's user avatar
3 votes
3 answers
1k views

How to sort each 20 lines in a 1000 line file and save only the sorted line with highest value in each interval to another file?

I have a file that has 1000 text lines. I want to sort the 4th column at each 20 lines interval and print the output to another file. Can anybody help me with sorting them with awk or sed? Here is an ...
Sanjukta's user avatar

15 30 50 per page
1
2 3 4 5
12