Maybe something like this would come closer to what you want:
which produces the following output if the file named file contains the sample data shown in post #1 in this thread:
Note that the first part of this script was modified to fix the problem RudiC noted in post #8.
Last edited by Don Cragun; 11-02-2015 at 03:17 PM..
Reason: Define tmpf for use by shell.
Hi
First field is the Record Type. A Record Type 5 can have multiple Record Type 6's before another Record Type 5 appears.
I want to calculate the total of fields at position 8-11 on Record type 6 when Record Type 5 has a field at position 11-14 equals to '2222'. then it should delete the lines... (2 Replies)
The file content is dynamic and using this format:
name1 number1
name2 number2
name3 number3
name4 number4
....................
Need a smooth way to calculate the sum of all the numbers in that file (number1 + number2 + number3 + number4........ = total ) (11 Replies)
Good afternoon! Im new at scripting and Im trying to write a script to
calculate total space, total used space and total free space in filesystem names matching a keyword (in this one we will use keyword virginia). Please dont be mean or harsh, like I said Im new and trying my best. Scripting... (4 Replies)
Hello Friends,
I have a file(InputFile.csv) with the following columns(the columns are pipe-delimited):
ColA|ColB|ColC|ColD|ColE|ColF
Now for this file, I have to get those records which fulfil the following condition:
If "ColB" is NOT NULL and "ColD" has values one of the following... (9 Replies)
Dears,
I need a script or command which can find the unique number from the second filed and against that number it adds the total of first field .
17215630 , 0
907043 ,1
201050 ,10
394149 ,4
1964 ,9
17215630, 0
907043 ,1
201050, 10
394149 ,4
1964 ,9
1234234, 55
23 ,100
33 ,67
... (2 Replies)
HI
I have a file
# cat marks.txt
MARKS LIST
2013
Name english french chinese latin total_marks
wer 34 45 67 23
wqa 12 39 10 56
wsy 23 90 23 78
Now i need to find the total marks of each student using... (11 Replies)
Hi All ,
I have the following script as below , I tried to modify to meet the requirement , could someone help ? very thanks
================================================================================================
while read STR NAME; do
Total=0
MyString="$STR"
GetData () {... (18 Replies)
Trying to use awk to print the lines in file that have either REF or SNV in $3, add a header line, sort by $4 in numerical order. The below code does that already, but where I am stuck is on the last part where the total lines are counted and printed under Total_Targets, under Targets_less_than is... (4 Replies)
I have been reading old posts and trying to come up with a solution for the below: Use a tab-delimited input file to assign
point to variables that are used to update a specific field, Rank. I really couldn't find too much in the way of assigning points
to variable, but made an attempt at an awk... (4 Replies)
Discussion started by: cmccabe
4 Replies
LEARN ABOUT HPUX
acctcms
acctcms(1M)acctcms(1M)NAME
acctcms - command summary from per-process accounting records
SYNOPSIS
[options] files
DESCRIPTION
reads one or more files, normally in the form described in acct(4). It adds all records for processes that executed identically-named com-
mands, sorts them, and writes them to the standard output, normally using an internal summary format.
Options
recognizes the following options:
Print output in
ASCII rather than in the internal summary format. The output includes command name, number of times executed, total kcore-
minutes, total CPU minutes, total real minutes, mean size (in K), mean CPU minutes per invocation, ``hog factor'', charac-
ters transferred, and blocks read and written, as in acctcom(1M). Output is normally sorted by total kcore-minutes.
Sort by total
CPU time, rather than total kcore-minutes.
Combine all commands invoked only once under
Sort by number of command invocations.
Any file names encountered hereafter are already in internal summary format.
Process all records as total accounting records.
The default internal summary format splits each field into prime- and non-prime-time parts. This option combines the prime
and non-prime time parts into a single field that is the total of both, and provides upward compatibility with old (i.e.,
UNIX System V) style internal summary format records.
The following options can be used only with the option.
Output a prime-time-only command summary.
Output a non-prime- (offshift) time only command summary.
When and are used together, a combination prime and non-prime time report is produced. All the output summaries are total usage except
number of times executed, CPU minutes, and real minutes which are split into prime and non-prime.
EXAMPLES
A typical sequence for performing daily command accounting and for maintaining a running total is:
WARNINGS
Unpredictable output results if is used on new-style internal-summary-format files, or if it is not used with old style internal summary
format files.
The process mean memory size may overflow for values greater than
SEE ALSO acct(1M), acctcom(1M), acctcon(1M), acctmerg(1M), acctprc(1M), acctsh(1M), fwtmp(1M), runacct(1M), acct(2), acct(4), utmp(4).
STANDARDS CONFORMANCE acctcms(1M)