Hello,
i am trying to write a script file in awk which yields me the number of lines,characters and words, i checked it many many times but i am not able to find any mistake in it. Please tell me where i went wrong.
BEGIN{
print "Filename Lines Words Chars\n"
}
{
filename=filename + 1... (2 Replies)
I want to sort lines by how many times a string occurs in each line (the most times first).
I know how to do this in two passes (add a count field in the first pass then sort on it in the second pass).
However, can it be done more optimally with a single AWK command? My AWK has improved... (11 Replies)
HI Unix Gurus,
I have a number of SELECT count(*) statements in an input file and I want to execute it using a shell script but one by one using loop in script....
How can I do this..... (7 Replies)
Hi, how can I count the lines where a word appears in a file, using AWK?
Example:
file.txt:
gold 1588 France
gold 1478 Spain
silver 1596 France
emerald 1584 UK
diamond 1478 Germany
gold 1639 USA
Number of lines where gold in text is = 3
I've try this, but all I get is the number... (3 Replies)
Hi ,
I have a file which has multiple rows of data, i want to match the pattern for two columns and if both conditions satisfied i have to add the counter by 1 and finally print the count value. How to proceed...
I tried in this way...
awk -F, 'BEGIN {cnt = 0} {if $6 == "VLY278" &&... (6 Replies)
Hello fellow awkers,
I am trying to combine the following awk statements into 1 so that the results are more accurate:
awk '/\=\+/ { count++ } END { print count}' filename
awk '/\=\?/ { count++ } END { print count}' filename
awk '/\=\-/ { count++ } END { print count}' filename
awk... (8 Replies)
Is there an efficient awk that can count the number of lines that occur in between two tags.
For instance, consider the following text:
<s>
Hi PP -
my VBD -
name DT -
is NN -
. SENT .
</s>
<s>
Her PP -
name VBD -
is DT -
the NN -
same WRT -
. SENT -
</s>
I am interested to know... (4 Replies)
What i'm trying to do here is show X amount of lines before and after the string "serialNumber" is found.
BEFORE=3
AFTER=2
gawk '{a=$0} {count=0} /serialNumber/ && /./ {for(i=NR-'"${BEFORE}"';i<=NR;i++){count++ ;print a}for(i=1;i<'"${AFTER}"';i++){getline; print ; count ++; print... (5 Replies)
I am trying to remove all the lines and spaces where the count in $4 or $5 is greater than 1 (more than 1 letter). The file and the output are tab-delimited. Thank you :).
file
X 5811530 . G C NLGN4X
17 10544696 . GA G MYH3
9 96439004 . C ... (1 Reply)
Discussion started by: cmccabe
1 Replies
LEARN ABOUT DEBIAN
accounting
ACCOUNTING(1) SMPPPD ACCOUNTING(1)NAME
accounting - calculates statistics about your internet connections
DESCRIPTION
accounting is a simple program to calculate statistics about your internet dial-up connections that are started and stopped by either ifup
and ifdown or by a frontend to smpppd like cinternet , qinternet or kinternet.
OPTIONS
These options are recognized by accounting. If a long option shows an argument as mandatory, then it is mandatory for the equivalent short
option also.
-l, --last=NUM
Only consider the last NUM connections.
-a, --after=DATE
Only consider connections started after DATE. DATE is a date with optional time in ISO 8601 format, e.g. `2002-12-24 20:15:00'.
Note that a date without time is treated as if the time is 00:00:00. Hence connections started on the specified date are consid-
ered.
-b, --before=DATE
Only consider connections started before DATE.
-u, --user=USER
Only consider connections started by user USER.
--this-year
Only consider connections started this year.
--last-year
Only consider connections started last year.
--this-month
Only consider connections started this month.
--last-month
Only consider connections started last month.
--this-week
Only consider connections started this week.
--last-week
Only consider connections started last week.
--today
Only consider connections started today.
--yesterday
Only consider connections started yesterday.
--per-year
Show summaries on a per year basis.
--per-month
Show summaries on a per month basis.
--per-week
Show summaries on a per week basis.
--per-day
Show summaries on a per day basis.
-c, --connections
Only list the connections but do not show provider statistics.
-p, --providers
Do not list the connections only show the provider statistics.
--connection-format=FORMAT
The names of the columns to print in the connection list. The names must be separated by a comma. Known column names are time,
type, provider, user, status, duration, rx, tx, rxtx, averx, avetx and averxtx. Each name may be appended by a colon and a number
indicating the width for the column, e.g. provider:25. The value will not be truncated if the width is too small.
--provider-format=FORMAT
The names of the columns to print in the provider list equivalent to the --connection-format option. Known column names are
provider, number, duration, rx, tx, rxtx, aveduration, averx, avetx and averxtx.
--local
Display all dates in local time. Also interpret dates on the command line in local time. This is the default.
--utc Display all dates in UTC. Also interpret dates on the command line in UTC.
--script[=STYLE]
Format output for script. Known styles are c and sh.
-f, --file=NAME
Use a different file with accounting information.
--report-errors
Report erros in the accounting file.
--version
Show program version and exit.
--help Show help information and exit.
NOTES
All informations are only obtained through the accounting log. Hence the informations, esp. the data volume, of currently active connec-
tions is not accurate. If you want the know the status of a connection, use ifstatus or a frontend to smpppd like cinternet , qinternet or
kinternet instead.
The user field is empty for connections started by a remote frontend of smpppd.
BUGS
Not yet implemented for ISDN (ippp).
FILES
/var/log/smpppd/accounting.log
File containing accounting information.
SEE ALSO
kinternet, qinternet, cinternet(1), smpppd(8), smpppd-ifcfg(8).
AUTHOR
Arvin Schnell <arvin@suse.de>
SuSE December 2002 ACCOUNTING(1)