10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
This is my file
vol0 285GB
vol0.snapshot 15GB
vol11_root 0GB
vol12_root 47GB
vol12_root.snapshot 2GB
I need the output
vol0 285GB,vol0.snapshot 15GB,sum-300GB
vol11_root 0GB,nosnap,sum-0Gb
vol12_root 47GB,vol12_root.snapshot 2GB,49GB
I was trying to use paste -d, --. But... (9 Replies)
Discussion started by: ranjancom2000
9 Replies
2. Shell Programming and Scripting
I have a XML in which <Amt Ccy="EUR">3.1</Amt> tag repeats. This is under another tag <Main>. I need to sum all the values of <Amt Ccy=""> (Ccy may vary) coming under <Main> using awk and or sed command.
can some help?
Sample looks like below
<root>
<Main>
... (6 Replies)
Discussion started by: bk_12345
6 Replies
3. Shell Programming and Scripting
// AIX 5.3 & AIX 6.1
ls -al |awk '{print $5}'
This gives each file's size in byte.
I need to get:
- the sum of all files in Giga bytes with loop.
- excluding the size of directories (ls -al returns the size of directories).
There are hundreds and thousands of files, so summing up... (8 Replies)
Discussion started by: Daniel Gate
8 Replies
4. Shell Programming and Scripting
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)
Discussion started by: kaaliakahn
3 Replies
5. Shell Programming and Scripting
I have a input.txt file which have 3 fields separate by a comma
place, os and timediff in seconds
tampa,win7, 2575
tampa,win7, 157619
tampa,win7, 3352
dallas,vista,604799
greenbay,winxp, 14400
greenbay,win7 , 518400
san jose,winxp, 228121
san jose,winxp, 70853
san jose,winxp, 193514... (5 Replies)
Discussion started by: sabercats
5 Replies
6. UNIX for Dummies Questions & Answers
Hi everyone, i need help with a simple task. I have a file withe the format:
"01/20/2012 23:10:13.979","49","49","48","19"
"01/20/2012 23:15:13.969","47","47","48","18"
"01/20/2012 23:20:13.975","47","47","45","17"
"01/20/2012 23:25:13.980","44","44","44","17"
"01/20/2012... (3 Replies)
Discussion started by: civilianwarfare
3 Replies
7. Shell Programming and Scripting
Hi all,
I need to sum values for fields in a delimited file as below:
2010-03-05|||
2010-03-05|||123
2010-03-05|467.621|369.532|
2010-03-06|||
2010-03-06||2|
2010-03-06|||444
2010-03-07|||
2010-03-07|||
2010-03-07|655.456|1019.301|
Code used is:
nawk -F "|" ' { sum +=... (7 Replies)
Discussion started by: Katabatic
7 Replies
8. Shell Programming and Scripting
Hi Experts,
I am adding a column of numbers with awk , however not getting correct output:
# awk '{sum+=$1} END {print sum}' datafile
2.15291e+06
How can I getthe output like : 2152910
Thank you..
# awk '{sum+=$1} END {print sum}' datafile
2.15079e+06 (3 Replies)
Discussion started by: rveri
3 Replies
9. Shell Programming and Scripting
Hi,consider this fields,
$1 $2 $3
981 0 1
984 0 4
985 1 0
987 0 2
990 0 0
993 0 3
995 2 0
996 0 1
999 0 4
for each occurence of zero in column $2 and $3 I need to sum $1 fields, so for example, in this piece of code the result of $1 is 8910. I'm sure... (2 Replies)
Discussion started by: cv313x
2 Replies
10. Shell Programming and Scripting
I have some data that is something like this?
item: onhand counted location
ITEM0001 1 0 a1
ITEM0001 0 1 a2
ITEM0002 5 0 b5
ITEM0002 0 6 c1
I want to sum up... (6 Replies)
Discussion started by: syadnom
6 Replies