use the square braket as well as the space charactere as fields separator
'tolower($3)~/full<pipe>txt/
According to those field separators if the third field set to lower case matches "full" or "txt"
{a[$3]=(a[$3]?a[$3] RS:z) $(NF-1)}
then build associative array indexed by the value of $3 and concatenate in element a[$3] the field N-1
a[$3]?a[$3] RS:z
just means : if a[$3] is true (means : is not null and not empty and not equal to zero), then assign it with itself + a record separator(new line), otherwise assign z (wich defaulty has not been assigned so its value is empty)
a[$3]=(a[$3]?a[$3] RS:z) $(NF-1)
concatenate the N-1** field to the previous expression and store it into the a[$3] element
(**)since space " " and closing square bracket "]" are record separator)
END{
once the whole input file has been processed
for(i in a) {
for all index existing in array a
print i":" RS a[i]}}'
Display the name of the index with ":" then new line, then the element that contains the list of concatenated entries found for that index
Hi,
I have a file with large number of records. Sample below:
123456789QWERT2U 2 erter
987123678ZXCVB6Y 5 7689
934567123GHJKUI4O 7
-
--
--
I want the 16th character in each record to be replaced with the below as follows;so 2 will become K, 6 will become O and 4 will become... (3 Replies)
If I have a string defined as:
MyString=abcde
echo $MyString
How can I loop through it character by character? I haven't been able to find a way to index the string so that I loop through it.
shew01 (10 Replies)
Use and complete the template provided. If you don't, your post may be deleted!
1. The problem statement, all variables and given/known data:
How can I count number of occurance of a single character in a file..
eg. How many '$' characters are there in account file..!
2. Relevant commands,... (1 Reply)
I am trying to match a pattern exactly in a shell script. I have tried two methods
awk '/\<mpath${CURR_MP}\>/{print $1 $2}' multipath
perl -ne '/\bmpath${CURR_MP}\b/ and print' /var/tmp/multipath
Both these methods require that I use the escape character. I am guessing that is why... (8 Replies)
I need to check whether first character of variable is single quote.
I tried the below constructions but they are all not working (always return true)
if (test `echo "$REGEXP" |cut -c1` != "'"); then echo "TRUE"; fi
if (test `echo "$REGEXP" |cut -c1` != '\''); then echo "TRUE"; fi
if (test... (5 Replies)
Hi all,
Here is the data file:
- want to match only lan3 in the output .
- not lan3:1
file :
OPERATING_SYSTEM=HP-UX
LOOPBACK_ADDRESS=127.0.0.1
INTERFACE_NAME="lan3"
IP_ADDRESS="10.53.52.241"
SUBNET_MASK="255.255.255.192"
BROADCAST_ADDRESS=""
INTERFACE_STATE=""... (2 Replies)
Hello All
I am struck in the issue which I want to share with all of you.
What I am trying to do is For every line in a file I have to replace a particular character from the given character in a file
For Example
Suppose the data is
1111x2222
1111x2222
2222y3333
1111x2222
I... (4 Replies)
Hello,
I want to check whether string has only numeric characters. The following code doesn't work for me
#!/usr/local/bin/bash
if ]]; then
echo "true"
else
echo "False"
fi
# ./yyy '346'
False
# ./yyy 'aaa'
False
I'm searching for solution using character classes, not regex.... (5 Replies)
Hi,
Anyone can help using SED searches a character string for a specified delimiter character, and returns a leading or trailing space/blank.
Text file :
"1"|"ExternalClassDEA519CF5"|"Art1"
"2"|"ExternalClass563EA516C"|"Art3"
"3"|"ExternalClass305ED16B8"|"Art9"
...
...
... (2 Replies)
Discussion started by: fspalero
2 Replies
LEARN ABOUT MOJAVE
net::dns::rr::rp5.18
Net::DNS::RR::RP(3) User Contributed Perl Documentation Net::DNS::RR::RP(3)NAME
Net::DNS::RR::RP - DNS RP resource record
SYNOPSIS
use Net::DNS;
$rr = new Net::DNS::RR('name RP mbox txtdname');
DESCRIPTION
Class for DNS Responsible Person (RP) resource records.
METHODS
The available methods are those inherited from the base class augmented by the type-specific methods defined in this package.
Use of undocumented package features or direct access to internal data structures is discouraged and could result in program termination or
other unpredictable behaviour.
mbox
$mbox = $rr->mbox;
A domain name which specifies the mailbox for the person responsible for this domain. Its format in master files uses the DNS convention
for mailbox encoding, identical to that used for the RNAME mailbox field in the SOA RR. The root domain name (just ".") may be specified
to indicate that no mailbox is available.
txtdname
$txtdname = $rr->txtdname;
A domain name identifying TXT RRs. A subsequent query can be performed to retrieve the associated TXT records. This provides a level of
indirection so that the entity can be referred to from multiple places in the DNS. The root domain name (just ".") may be specified to
indicate that no associated TXT RR exists.
COPYRIGHT
Copyright (c)1997-2002 Michael Fuhr.
Package template (c)2009,2012 O.M.Kolkman and R.W.Franks.
All rights reserved.
This program is free software; you may redistribute it and/or modify it under the same terms as Perl itself.
SEE ALSO
perl, Net::DNS, Net::DNS::RR, RFC1183 Section 2.2
perl v5.18.2 2014-01-16 Net::DNS::RR::RP(3)