08-30-2017
Quote:
Originally Posted by
vgersh99
where exactly are you stuck?
I need to sum of values (Third column) for rows having same name (column 1 and column 2) it should sum only within that date range.
Refer my example .I tried to do this with awk but no luck
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hey,
I have a file and it has only one field. I need to calculate the sum of each filed as total.
For e.g my file is
1
2
3
4
5
I need to calculate the total sum as 15.
Please let me know how i can do it? (4 Replies)
Discussion started by: dsravan
4 Replies
2. Shell Programming and Scripting
Hi
I have the following file, how I will calculate the sum of all the entries in the file.
> cat abc
2
3
4
now the sum should be 2+3+4 = 9 (4 Replies)
Discussion started by: sdosanjh
4 Replies
3. Shell Programming and Scripting
how to sum particular field in text file
i am having text file like
222|4000|abc
333|5000|xyz
444|6000|mno
i want sum of second field
i.e 4000+5000+6000
can u pls help (3 Replies)
Discussion started by: suryanarayana
3 Replies
4. UNIX for Dummies Questions & Answers
Hi,
I have a small requirement where i need to sum up a column in a text file.
Input file
66ab 000000 534385 -00000106350.00
66cd 000000 534485 -00013364511.00
66ad 000000 534485 -00000426548.00
672a 000000 534485 000000650339.82... (5 Replies)
Discussion started by: pssandeep
5 Replies
5. Shell Programming and Scripting
Hi
i data looks like this:
student 1
Subject1 45 55
Subject2 44 55
Subject3 33 44
//
student 2
Subject1 45 55
Subject2 44 55
Subject3 33 44
i would like to sum $2, $3 (marks) and divide each entry in $2 and $3 with their respective sums and print for each student as $4 and... (2 Replies)
Discussion started by: saint2006
2 Replies
6. Shell Programming and Scripting
Hi,
I need to do a sum of two columns in a file where delimiter is |^
input
1|^2|^3|^4|^50|^2|^3|^100
2|^3|^4|^6|^100|^7|^2|^50
3|^4|^2|^3|^50|^6|^3|^50
4|^2|^5|^7|^25|^2|^8|^25
Output required:
Sum of 2 columns 5 & 8 which is 450 (11 Replies)
Discussion started by: Jram
11 Replies
7. Shell Programming and Scripting
Hi everyone,
Here are the contents of a plain text file created by a SQL query:
SUM(T.TRNQTY) COUNT(D.TRNSEQ)
---------------- ----------------
1380 46
1393 59
2680 134
740 37
... (5 Replies)
Discussion started by: gacanepa
5 Replies
8. Shell Programming and Scripting
I need to sum values in text file in case duplicate row are present with same name and different value below is example of data in file i have and format i need.
Data in text file
20170308
PM,U,2
PM,U,113
PM,I,123
DA,U,135
DA,I,113
DA,I,1
20170309
PM,U,2
PM,U,1
PM,I,123
PM,I,1... (3 Replies)
Discussion started by: Adfire
3 Replies
9. Shell Programming and Scripting
In the awk below I am trying to add a penalty to a score to each matching $1 in file2 based on the sum of $3+$4 (variable TL) from file1. Then the $4 value in file1 is divided by TL and multiplied by 100 (this valvue is variable S). Finally, $2 in file2 - S gives the updated $2 result in file2.... (2 Replies)
Discussion started by: cmccabe
2 Replies
10. Shell Programming and Scripting
hi all,
trying this using shell/bash with sed/awk/grep
I have two files, one containing one column, the other containing multiple columns (comma delimited).
file1.txt
abc12345
def12345
ghi54321
...
file2.txt
abc1,text1,texta
abc,text2,textb
def123,text3,textc
gh,text4,textd... (6 Replies)
Discussion started by: shogun1970
6 Replies
LEARN ABOUT OPENSOLARIS
fruadm
fruadm(1M) System Administration Commands fruadm(1M)
NAME
fruadm - prints and updates customer data associated with FRUs
SYNOPSIS
/usr/platform/sun4u/sbin/fruadm
/usr/platform/sun4u/sbin/fruadm -l
/usr/platform/sun4u/sbin/fruadm [-r] path [text]
DESCRIPTION
fruadm prints or sets the customer data for Field-Replaceable Units (FRUs).
Without arguments, fruadm prints the paths of all FRU ID-capable FRUs (containers) in the system, along with the contents of the customer
data record, if present, for each such FRU; for FRUs without customer data, fruadm prints only the container's path.
Only a privileged user can create or update data in containers. The privileges required to perform these write operations are hardware
dependent. Typically, a default system configuration restricts write operations to the superuser or to the platform-administrator user.
OPTIONS
The following options are supported:
-l List the system's frutree paths.
-r Recursively display or update the data for all containers rooted at the argument path.
OPERANDS
The following operands are supported:
path A full or partial system frutree path for or under which to print or set the customer data. The first field of each line of output
of fruadm -l gives the valid full frutree paths for the system.
Paths can include shell meta-characters; such paths should be quoted appropriately for the user's shell. For partial paths, the
first matching full path is selected for display or update. Without the -r option, the path must be that of a container; with the
-r option, all containers (if any) under path will be selected.
text Up to 80 characters of text set as the customer data. If the text contains white space or shell metacharacters, it should be quoted
appropriately for the user's shell.
EXAMPLES
Example 1 Displaying All Customer Data
The following example prints all customer data available from FRUs on the system. For containers with no customer data, only the contain-
ers' paths will be listed.
example% fruadm
Example 2 Displaying Customer Data For a Single FRU
The following command prints the customer data, if present, for the specified FRU:
example% fruadm /frutree/chassis/system-board
Example 3 Displaying Customer Data For a Single FRU
The following command prints the customer data, if present, for the first mem-module found:
example% fruadm mem-module
Example 4 Setting Customer Data
The following example sets the customer data for a FRU:
example# fruadm system-board 'Asset Tag 123456'
Example 5 Setting Customer Data
The following command sets the customer data for all FRUs under chassis:
example# fruadm -r /frutree/chassis "Property of XYZ, Inc."
EXIT STATUS
The following exit values are returned:
0 Successful completion.
>0 An error occurred.
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Availability |SUNWfruip.u |
+-----------------------------+-----------------------------+
|Interface Stability |Unstable |
+-----------------------------+-----------------------------+
SEE ALSO
prtfru(1M), attributes(5)
SunOS 5.11 22 Feb 2002 fruadm(1M)