i have an awk statement which i am using to count the number of occurences of the number ,5, in the file:
awk '/,5,/ {count++}' TRY.txt | awk 'END { printf(" Total parts: %d",count)}'
i know there is a total of 10 matches..what is wrong here?
thanks (16 Replies)
I want to keep a count of a all the records processed in a input file. The input file would have a lot of data containing various information. Lets say I make a pattern that only prints out data with the amount $37.57. How would I go about keeping track of how many $37.57 appears?
I have... (2 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)
I am having a zipped file which has the following URL contents -
98.70.217.222 - - "GET /liveupdate-aka.symantec.com/1340071490jtun_nav2k8enn09m25.m25?h=abcdefgh HTTP/1.1" 200 159229484 "-" "hBU1OhDsPXknMepDBJNScBj4BQcmUz5TwAAAAA" "-"
In this line here is we only need to consider the... (4 Replies)
I am trying to search a file for a patterns ERR- in a file and return a count for each of the error reported
Input file is a free flowing file without any format
example of output
ERR-00001=5
....
ERR-01010=10
.....
ERR-99999=10 (4 Replies)
Hi all I have a need of searching some pattern in file by month and then count unique records
D11
G11
R11 -------> Pattern available in file
S11
Jan$1 to $5 column contains some records in which I want to find unique
for this purpose I have written script like below
awk '/Jan/ ||... (4 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)
Guys -
Need your ideas on a section of code to finish something up. To make a long story short, I'm parsing a print output file that goes to pre-printed forms. I'm intercepting it, parsing it, formatting it, cutting it up into individual pages, grabbing the text I want in zones, building an... (3 Replies)
hi ,
I have a below file which contain as
Use descriptive thread titles when posting Urgent.
For example, do not post questions with subjects like "Help Me!", "Urgent Urgent Urgent" .
or "Doubt". Post subjects like "Execution Problems with Cron" or "Help with Backup Shell Script".... (7 Replies)
I need to get a count of all the records that start with 4 and then print the value.
I have the below statement but it is missing something, can someone help me to fix this
awk 'BEGIN{~/^4/{C++}};END {print"<Total>"} {print"<Reg>"}{print "<value>"C"</value></Reg>"}' {print"</Total>"} temp >... (2 Replies)
Discussion started by: rosebud123
2 Replies
LEARN ABOUT HPUX
makedbm
makedbm(1M)makedbm(1M)NAME
makedbm - make a Network Information System database
SYNOPSIS
nis_input_file] nis_output_name] nis_domain_name] nis_master_name] infile outfile
database_name
Remarks
The Network Information Service (NIS) was formerly known as Yellow Pages (yp). Although the name has changed, the functionality of the
service remains the same.
DESCRIPTION
generates databases (maps) for the Network Information System (NIS) from infile. A database created by consists of two files: and A data-
base contains records called dbm records composed of key-value pairs.
Each line of infile is converted to a single dbm record; all characters up to the first tab or space form the key, and the remainder of the
line is the value. If a value read from infile ends with the value for that record is continued onto the next line. The NIS clients must
interpret the character (which means that does not treat the as if it precedes a comment). If infile is a hyphen reads standard input.
always generates a special dbm record with the key whose value is the time of last modification of infile (or the current time, if infile
is This value is also known as the order number of a map, and prints it for a specified NIS map (see yppoll(1M)).
Another special dbm record created by has the key Its value is usually the host name retrieved by however, the option can be used to spec-
ify a different value (see gethostname(2)).
If the option is used, another special dbm record with the key is created. When this key exists in the NIS host.by* maps or ipnodes.by*
maps and the NIS host name resolution fails, the process will query the Internet domain name server, to provide the host name resolution.
Before using the option, it is recommended that the name services switch, be set to allow NIS host name resolution first. (Note that,
since the process only checks hosts.by* and ipnodes.by* for the existence of the key, using the option on any other NIS map will have no
effect. Also, the option should be used on both the *.byname and *.byaddr maps, not one exclusively.)
If the option is used, another special dbm record created is the key. If this key exists in an NIS map, will only allow privileged pro-
cesses (applications that can create reserved ports) to access the data within the map.
Options
recognizes the following options and command-line arguments.
Create a special dbm record with the key
This key, which is in the hosts.byname, hosts.byaddr, ipnodes.byname, and ipnodes.byaddr maps, allows the process to query the
Internet domain name server (see named(1M)).
Convert the keys of the given map to lowercase.
This command option allows host name matches to work independent of character-case distinctions.
Accept connections from secure NIS networks only.
Create a special dbm record with the key
and the value If the option is used, another special dbm record created is the key. If this key exists in an NIS map, will only
allow privileged processes to access the data within the map (that is, applications that can create reserved ports).
Create a special dbm record with the key
and the value nis_output_name.
Create a special dbm record with the key
and the value nis_domain_name.
Replace the value of the special dbm record whose key is
with nis_master_name.
Undo the
database_name (that is, write the contents of database_name to the standard output) one dbm record per line. A single space sepa-
rates each key from its value.
EXAMPLES
Shell scripts can be written to convert ASCII files such as to the key-value form used by For example,
#!/usr/bin/sh
/usr/bin/awk 'BEGIN { FS = ":" } { print $1, $0 }'
/etc/netgroup |
makedbm - netgroup
converts the file to a form that is read by to make the NIS map The keys in the database are names, and the values are the remainders of
the lines in the file.
AUTHOR
was developed by Sun Microsystems, Inc.
SEE ALSO domainname(1), named(1M), ypinit(1M), ypmake(1M), yppoll(1M), gethostname(2), netgroup(4), ypfiles(4).
makedbm(1M)