10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Hello. Trying to add a column of numbers and combine the 1st and 2nd fields as uniq with the new total.
This works to add the numbers but can't figure an easy was to combine the 1st and 2nd column as the list is very long. awk '{s+=$3} END {print s}'
bird dog 300
bird dog 100
cat clown 200... (1 Reply)
Discussion started by: jimmyf
1 Replies
2. Shell Programming and Scripting
Given a file test.txt ,I can get a list of numbers in a single column using the command :
cat test.txt | cut -d ' ' -f 8 that gives the output as
52
52
52
60
52
How can I get the sum of all the numbers in that column that is displayed?
i want the output as
sum=268 (4 Replies)
Discussion started by: hitha87
4 Replies
3. Shell Programming and Scripting
Problem discription:
I have many files which contain the same lines.
for instance, (15 lines) file1 ..last column add by hand arbitrarily.
1.78116800 0.68396600 0.00061900
0.47641600 -0.49794500 -0.00024000
-1.70662800 0.29577100 0.67863600
-1.70647600 0.29654600 ... (9 Replies)
Discussion started by: liuzhencc
9 Replies
4. Shell Programming and Scripting
Hi,
I have a system under test, and I use a script that does a ps.
The output, is in the following format, it's basically the timestamp, followed by the rss and vsize.
09:03:57 68404 183656 68312 181944 69860 217360 67536 182564 69072 183172 69032 199276
09:04:27 68752 183292 70000 189020... (5 Replies)
Discussion started by: Bloke
5 Replies
5. Shell Programming and Scripting
Howdy experts,
We have some ranges of number which belongs to particual group as below.
GroupNo StartRange EndRange
Group0125 935300 935399
Group2006 935400 935476
937430 937459
Group0324 935477 935549
... (6 Replies)
Discussion started by: thepurple
6 Replies
6. UNIX for Dummies Questions & Answers
I have UWIn version of Unix for Desktop.
I have a file (Subtitle file of a movie) with the following format
abc def ghi jkl
mno pqr stuv
uvw xyz
The subtitles are delayed about a min or few seconds more. I want to increase it to be as shown below:
abc def ghi jkl
mno pqr stuv
... (4 Replies)
Discussion started by: bobbygsk
4 Replies
7. Shell Programming and Scripting
Hello all
siteexplorer.search.yahoo.com can output results in tsv format, when opened in excel I get 4 columns.
I would like to wget that file, which I can do. I would then like to pull the 2nd column and output it only.
I've searched around and found a few bits and pieces but nothing I've... (6 Replies)
Discussion started by: casphar
6 Replies
8. Shell Programming and Scripting
Hi All thanks a lot for your previous replies. I need some help here. I am writing a script to test a machine for a thereshold. It is genrating the list of number that have to be added but not displaying the added value.
The script is like this
#!/bin/sh... (1 Reply)
Discussion started by: asirohi
1 Replies
9. UNIX for Advanced & Expert Users
Hello, I have a file, and one column has both positive and negative numbers. Does anyone know how I can calculate the total of all the values (i.e, +ve and -ve).
eg:
col1 col2 col3
data 23 data
data 76 data
data -30 data
Thanks
Khoom (1 Reply)
Discussion started by: Khoomfire
1 Replies
10. Shell Programming and Scripting
Hi,
i want to sum all nubers in one column. Example:
12.23
11
23.01
3544.01
I'm trying to do this in awk, but it doesn't work properly.
Seems like awk is summing only integers, for example:
12
11
23
3544
It cuts off numbers after dot.
I used this command:
akw /text/ file.txt |nawk... (1 Reply)
Discussion started by: iahveh
1 Replies