Sponsored Content
Full Discussion: Counting entries in a file
Top Forums Shell Programming and Scripting Counting entries in a file Post 302561683 by sajal.bhatia on Wednesday 5th of October 2011 12:26:16 AM
Old 10-05-2011
I have another column to the input file and would like to sum-up and print the entries of that column for the user specified time interval. For e.g. if the user specifies 5 second as the input, the script should add all the entries of the third column for this 5 sec interval and print it alongside the other information being currently printed by the above script i.e. Time-stamp, number of packets, number of uniq IPs in that interval and number of new IP in that interval as compared to the previous interval.

Looking for a solution.

Cheers,
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Counting words in a file

I'm trying to figure out a way to count the number of words in the follwing file: cal 2002 > file1 Is there anyway to do this without using wc but instead using the cut command? (1 Reply)
Discussion started by: r0mulus
1 Replies

2. Shell Programming and Scripting

Help me in counting records from file

Hi, Please help me in counting the below records(1st field) from samplefile: Expected output: Count Descr ------------------------------------------- 7 Mean manager 14 ... (7 Replies)
Discussion started by: prashant43
7 Replies

3. Programming

Counting the words in a file

Please find the below program. It contains the purpose of the program itself. /* Program : Write a program to count the number of words in a given text file */ /* Date : 12-June-2010 */ # include <stdio.h> # include <stdlib.h> # include <string.h> int main( int argc, char *argv ) {... (6 Replies)
Discussion started by: ramkrix
6 Replies

4. Shell Programming and Scripting

Counting multiple entries in a file using awk

Hi, I have a big file (~960MB) having epoch time values (~50 million entries) which looks like 897393601 897393601 897393601 897393601 897393602 897393602 897393602 897393602 897393602 897393603 897393603 897393603 897393603 and so on....each time stamp has more than one... (6 Replies)
Discussion started by: sajal.bhatia
6 Replies

5. Shell Programming and Scripting

Counting duplicate entries in a file using awk

Hi, I have a very big (with around 1 million entries) txt file with IPv4 addresses in the standard format, i.e. a.b.c.d The file looks like 10.1.1.1 10.1.1.1 10.1.1.1 10.1.2.4 10.1.2.4 12.1.5.6 . . . . and so on.... There are duplicate/multiple entries for some IP... (3 Replies)
Discussion started by: sajal.bhatia
3 Replies

6. Shell Programming and Scripting

Counting characters within a file

Ok say I wanted to count every Y in a data file. Then set Y as my delimiter so that I can separate my file by taking all the contents that occur BEFORE the first Y and store them in a variable so that I may use this content later on in my program. Then I could do the same thing with the next Y's... (5 Replies)
Discussion started by: puttster
5 Replies

7. UNIX for Dummies Questions & Answers

Counting feilds entries with Perl

Hi All, I have a small problem of counting the number of times a particular entry that exists in a horizontal string of elements and a vertical feild (column of entries). For example AATGGTCCTGExpected outputA=2 C=2 G=3 T=3 I have an idea to do this but I dont know how to do that if these entries... (1 Reply)
Discussion started by: pawannoel
1 Replies

8. Shell Programming and Scripting

Counting lines in a file using awk

I want to count lines of a file using AWK (only) and not in the END part like this awk 'END{print FNR}' because I want to use it. Does anyone know of a way? Thanks a lot. (7 Replies)
Discussion started by: guitarist684
7 Replies

9. Shell Programming and Scripting

Need help of counting no of column of a file

Hi All , I got stuck on the below scenario.If anyone can help me ,that will be really helpful. I have a target hdfs file layout.I need to know the no of column in that file. Target_RECRD_layout { ABC_ID EN NOTNULLABLE, ABC_COUNTRY CHARACTER ENCODING ASCII NOTNULLABLE, ... (5 Replies)
Discussion started by: STCET22
5 Replies

10. Shell Programming and Scripting

Counting and print from file

Dear community, I have an already filtered log on my machine, something like: WARN 2016.03.10 10:59:01.136 logging.LogAlarmListener raise ALARMWARNINGRAISED Alarm NODE-NetworkAccessGroup.Client.41283 SERVICEDOWN-41283.WC severity WARNING raised: Service 41283.WC protocoltype client is down... (13 Replies)
Discussion started by: Lord Spectre
13 Replies
QwtLog10ScaleEngine(3)						 Qwt User's Guide					    QwtLog10ScaleEngine(3)

NAME
QwtLog10ScaleEngine - A scale engine for logarithmic (base 10) scales. SYNOPSIS
#include <qwt_scale_engine.h> Inherits QwtScaleEngine. Public Types enum Attribute { NoAttribute = 0, IncludeReference = 1, Symmetric = 2, Floating = 4, Inverted = 8 } Public Member Functions int attributes () const virtual void autoScale (int maxSteps, double &x1, double &x2, double &stepSize) const virtual QwtScaleDiv divideScale (double x1, double x2, int numMajorSteps, int numMinorSteps, double stepSize=0.0) const double lowerMargin () const double reference () const void setAttribute (Attribute, bool on=true) void setAttributes (int) void setMargins (double lower, double upper) void setReference (double reference) bool testAttribute (Attribute) const virtual QwtScaleTransformation * transformation () const double upperMargin () const Protected Member Functions QwtDoubleInterval buildInterval (double v) const bool contains (const QwtDoubleInterval &, double val) const double divideInterval (double interval, int numSteps) const QwtDoubleInterval log10 (const QwtDoubleInterval &) const QwtDoubleInterval pow10 (const QwtDoubleInterval &) const QwtValueList strip (const QwtValueList &, const QwtDoubleInterval &) const Detailed Description A scale engine for logarithmic (base 10) scales. ight The step size is measured in *decades* and the major step size will be adjusted to fit the pattern $t 1,2,3,5 Warning: the step size as well as the margins are measured in *decades*. Member Enumeration Documentation enum QwtScaleEngine::Attribute [inherited] .IP o 2 IncludeReference Build a scale which includes the reference() value. o Symmetric Build a scale which is symmetric to the reference() value. o Floating The endpoints of the scale are supposed to be equal the outmost included values plus the specified margins (see setMargins()). If this attribute is *not* set, the endpoints of the scale will be integer multiples of the step size. o Inverted Turn the scale upside down. See also: setAttribute(), testAttribute(), reference(), lowerMargin(), upperMargin() Member Function Documentation int QwtScaleEngine::attributes () const [inherited] Return the scale attributes See also: Attribute, setAttributes(), testAttribute() void QwtLog10ScaleEngine::autoScale (intmaxNumSteps, double &x1, double &x2, double &stepSize) const [virtual] Align and divide an interval Parameters: maxNumSteps Max. number of steps x1 First limit of the interval (In/Out) x2 Second limit of the interval (In/Out) stepSize Step size (Out) See also: QwtScaleEngine::setAttribute() Implements QwtScaleEngine. QwtDoubleInterval QwtScaleEngine::buildInterval (doublev) const [protected, inherited] Build an interval for a value. In case of v == 0.0 the interval is [-0.5, 0.5], otherwide it is [0.5 * v, 1.5 * v] bool QwtScaleEngine::contains (const QwtDoubleInterval &interval, doublevalue) const [protected, inherited] Check if an interval 'contains' a value Parameters: interval Interval value Value See also: QwtScaleArithmetic::compareEps() double QwtScaleEngine::divideInterval (doubleintervalSize, intnumSteps) const [protected, inherited] Calculate a step size for an interval size Parameters: intervalSize Interval size numSteps Number of steps Returns: Step size QwtScaleDiv QwtLog10ScaleEngine::divideScale (doublex1, doublex2, intmaxMajSteps, intmaxMinSteps, doublestepSize = 0.0) const [virtual] Calculate a scale division. Parameters: x1 First interval limit x2 Second interval limit maxMajSteps Maximum for the number of major steps maxMinSteps Maximum number of minor steps stepSize Step size. If stepSize == 0, the scaleEngine calculates one. See also: QwtScaleEngine::stepSize(), QwtLog10ScaleEngine::subDivide() Implements QwtScaleEngine. QwtDoubleInterval QwtLog10ScaleEngine::log10 (const QwtDoubleInterval &interval) const [protected] Return the interval [log10(interval.minValue(), log10(interval.maxValue] double QwtScaleEngine::lowerMargin () const [inherited] Returns: the margin at the lower end of the scale The default margin is 0. See also: setMargins() QwtDoubleInterval QwtLog10ScaleEngine::pow10 (const QwtDoubleInterval &interval) const [protected] Return the interval [pow10(interval.minValue(), pow10(interval.maxValue] double QwtScaleEngine::reference () const [inherited] Returns: the reference value See also: setReference(), setAttribute() void QwtScaleEngine::setAttribute (Attributeattribute, boolon = true) [inherited] Change a scale attribute Parameters: attribute Attribute to change on On/Off See also: Attribute, testAttribute() void QwtScaleEngine::setAttributes (intattributes) [inherited] Change the scale attribute Parameters: attributes Set scale attributes See also: Attribute, attributes() void QwtScaleEngine::setMargins (doublelower, doubleupper) [inherited] Specify margins at the scale's endpoints. Parameters: lower minimum distance between the scale's lower boundary and the smallest enclosed value upper minimum distance between the scale's upper boundary and the greatest enclosed value Margins can be used to leave a minimum amount of space between the enclosed intervals and the boundaries of the scale. Warning: o QwtLog10ScaleEngine measures the margins in decades. See also: upperMargin(), lowerMargin() void QwtScaleEngine::setReference (doubler) [inherited] Specify a reference point. Parameters: r new reference value The reference point is needed if options IncludeReference or Symmetric are active. Its default value is 0.0. See also: Attribute QwtValueList QwtScaleEngine::strip (const QwtValueList &ticks, const QwtDoubleInterval &interval) const [protected, inherited] Remove ticks from a list, that are not inside an interval Parameters: ticks Tick list interval Interval Returns: Stripped tick list bool QwtScaleEngine::testAttribute (Attributeattribute) const [inherited] Check if a attribute is set. Parameters: attribute Attribute to be tested See also: Attribute, setAttribute() QwtScaleTransformation * QwtLog10ScaleEngine::transformation () const [virtual] Return a transformation, for logarithmic (base 10) scales Implements QwtScaleEngine. double QwtScaleEngine::upperMargin () const [inherited] Returns: the margin at the upper end of the scale The default margin is 0. See also: setMargins() Author Generated automatically by Doxygen for Qwt User's Guide from the source code. Version 5.2.2 Mon Aug 1 2011 QwtLog10ScaleEngine(3)
All times are GMT -4. The time now is 10:08 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy