Setting RS to the empty string is a special condition where records are split if there are two consecutive newlines. There would not be a limit on the number of records.
There would be a limitation per record, if the record exceeds the maximum length, which would not happen very quickly, but in the awk version of HP-UX (that is what I think this it, right? ) sooner than on some other platforms..
-- {fp=$NF} belongs to the preceding condition-action pair.
fp{print v,ps,fp;fp="";}' means if fp is neither empty nor zero then process {print v,ps,fp;fp="";}
--
Here is another version without RS=
or
Last edited by Scrutinizer; 01-06-2013 at 03:18 AM..
This User Gave Thanks to Scrutinizer For This Post:
I am trying to use a line of output in an XML file as input in another new XML file for processing purposes via a shell script. Since I am a newbie though, I'm not sure how to do this since the data is different everytime. I am using this technique with static data right now:
echo -n "Running... (5 Replies)
Hi Can any one help me remove the unwanted data? I would want to remove the complete event id 4910 ( the type there is INFO), that means, I have to remove starting from 7th - 19th lines. can any one of you please help?
Thanks, (24 Replies)
Hi,
I am stuck on writing a script that reads a file, retains wanted data but discards unwanted data from a CSV file.
This is a sample of my table {not the actual data)
ID Color tel_num Name color2 color3
abcdef green 5551212 jj88 red blue
acbdfe yellow... (5 Replies)
Hi,
I am doing some data parsing for some economics research. I was recently exposed to shell script and am brand new to awk. I have a large csv file (like 10G) and I would like to make it a lot smaller with awk, but it is a bit tricky for me and I haven't been able to get it yet. I would... (5 Replies)
hi
i have my input data like this
aaa bbb ccc
asa dff nmj
mnj saa dff
oik
aax cdx saa
oik
asq sdf dssi want my output file to be like this
mnj saa dff oik
aax cdx saa oiki want to retain only those lines which will have oik just below them and i want oik to be as next column to those... (1 Reply)
Heya,
I'm currently working on a script so I can see which cron jobs, if any, on a system are executing less frequently than 15 minutes (1 - 14 minutes). This is the only data I'm interested in. So far I have the following:
#!/bin/bash
IFS=$'\n';for line in `ls -f /var/spool/cron/*`;
do... (5 Replies)
Hi folks
I have a script I wrote that basically parses a bunch of config and xml files works out were to add in the new content then spits out the data into a new file.
It all works - apart from the xml and config file format in the new file
with XML files the original XML (that ends up in... (2 Replies)
Hi!
I have a pretty complex job - at least for me!
i have two csv-files with meassurement-data:
fileA
...... (2 Replies)
Discussion started by: IMPe
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)