I have a file containing data in a single column .. I ha开发者_StackOverflow中文版ve to find the sum of every 4 lines and print the sum
I have to solve an exercise using awk. Basically I need to retrieve from \'ps aux\' command the total of memory usage for each user and format like this:
For instance, I needed to remove column 25 and replace it with a copy of column 22 in a simple csv file with no embedded delimiters.The b开发者_如何学Cest I could come up with was the awkward looking:
I can\'t search for a particular string, since they\'re all very similar, but I\'d like something simple to chop out the first 4 lines in a file.
Too cumbersome: awk \'{print \" \"$4\"开发者_如何学C \"$5\" \"$6\" \"$7\" \"$8\" \"$9\" \"$10\" \"$11\" \"$12\" \"$13}\' things
This is one line of the input file: FOO BAR 0.40 0.20 0.40 0.50 0.60 0.80 0.50 0.50 0.50 -43.00 100010101101110101000111010
I have two text files, I want to place a text in the middle of another, I did some research and found information about adding single strings:
Operating System: OSX Method: From the command line, so using sed, cut, gawk, although preferably no installing modules.
Given the开发者_运维技巧 following command, echo "1: " | awk \'/1/ -F ":" {print $1}\'
I have a data that looks like this: foo fooscaffold_71 4845 6422 4845 bar barscaffold_7-1 14689 16310 16310