Hi All,
I have a file like -
num.txt
12, 34, 65, line1
34, 65, 89, line2
43, 65, 77, line3
I want to do two things -
1. Add first three columns of each line and print the line with largest value.
i.e. (12+34+65) for 1st line and so on.
2. Add middle column of each line i.e.... (3 Replies)
:rolleyes:Hi,
I need to find the sum of size of specific files in my directory
Say for ex,
mydir$ ls -ltr
permisssion links user group size date time filename
I want to display the sum of size of filenames having pattern "TS55". Note file size in this directory is near 400 MB.
mydir$... (1 Reply)
Hi,
I have a fixed width file with some records as given below:
" 1000Nalsdjflj243324jljlj"
"-0300Njfowjljl309933fsf"
" 0010Njsfsjklj342344fsl"
I want to sum-up first field values(i.e from 2nd character to 6th character)of each record.
so for the above file i want to add (1000 - 300+... (2 Replies)
Hi friends,
This is sed & awk type question.
I have a text file which has numbers spread all over the file. I want to sum the series of numbers whenever i find it and produce an output file with the sum. For example
###start of input text file ####
abc
def
ghi
1
2
3
4
kjld
random... (3 Replies)
Hi friends,
This is sed & awk type question. It is slightly different from my previous question.
I have a text file which has numbers spread all over the file. I want to sum the series of numbers (but no more than 10 numbers in series) whenever i find it and produce an output file with the... (4 Replies)
Hi
I would like to know if it is possible to sum some specific fields.
I have this
x;x;x;x;x;x;x;x;467,390,611 Bytes;0.435291 GB;0.062247 GB;0.373045 GB;11,225;157
a;a;a;a;a;a;a;a;13,805,156,846 Bytes;12.857054 GB;1.838559 GB;11.018495 GB;151,063;18,933
b;b;b;b;b;b;b;b;232,797,478,723... (5 Replies)
I was just curious about how to sum the total file size of a certain type of file. For instance:
$find . -name "*.aif"
will print out the paths to each .aif file. Instead of printing, how could one sum the total space used by all of the aif files? Thanks!
Please use code tags (3 Replies)
I'm trying to sum a text file using AWK. Here is an example of the file:
600|3H68| 46
600|3H69| 46
600|3H6F| 290
600|3H6G| 24
600|3HDY| 1
600|3HDY| 3
600|3HE0| 1
600|3HE0| 3
I would like to sum the third field if the first... (7 Replies)
I was playing around to see how stuff works, and was trying to sum all fields in a file.
cat file
1 2 3 4
5 6 7 8
9 10 11 12
I made this script:
awk 'BEGIN {OFS=RS}{$1=$1}{s+=$0} END {print "sum="s}' file
This gives 15, why not 78?
I test it like this
awk 'BEGIN... (5 Replies)