You don't need if-else for this. The 'ignore' happens by default anyway, you don't need a case for that.
You can put a condition in front of a code block which will cause it to be executed only when it's true, sort of like an if. Also, you can do math on columns directly.
The ($3+0) is just to turn the third column, $3, from a string into a number so < > = will work on it as expected.
Last edited by Corona688; 07-11-2012 at 01:59 PM..
I have been searching around the forums here trying to find a solution to my problem but not getting anywhere but closer to baldness.
I have a 20 column pipe "|" seperated text file. The 14th variable doesnt always exist, but will have the format of YYYYMM or YYYY if it does.
I need to take... (2 Replies)
Hi all,
I need help manipulating the file below.
Here is what I needed to do.
First, I have to replace INSUPD to DELETE.
Then I need to change the content of the file around by flipping the contents in the file from the bottom to the top (start from "CMD")
How should I attack this?
Here... (2 Replies)
Hi,
I have two issues:
I have one file say file1.dat and its over 3GB. It contains pipe delimited fields. The first line in the file is the header field which tells the column names etc. and from second line it's the data fileds with pipe delimited. Something like below:
... (5 Replies)
Hi.
I am reasonably new to awk, but have done quite a lot of unix scripting in the past. I have resolved the issues below with unix scripting but it runs like a dog. Moved to awk for speed and functionality but running up a big learning curve in a hurry, so hope there is some help here.
I... (6 Replies)
Hi Guys,
Is there a simple way of doing the below.
Available<spaces>Assigned<spaces>Maximum<spaces>Maximum<spaces>Page<spaces>Total <spaces>Used<spaces>Pct<spaces>Max. Pct<CR>
Space<spaces>Capacity<spaces>Extension<spaces>Reduction<spaces>Size<spaces>... (8 Replies)
hi good day
I have a number of text files (xyz) that I want to format in to defined column widths (that is 7 digits (padding with zeros in cases where necessary) with 6 decimal places) using awk.
.
I can perform this on one text file at a time without any problems.
However I want to write a... (2 Replies)
Hi,
My variable has value as this:
tvar1="bool_risk_enabled" Boolean "true"
Now I need to replace this true with false. Which is the best way to do this? Can we do this with sed command?
Please help me.
---------- Post updated at 05:23 PM ---------- Previous update was at 05:00 PM... (2 Replies)
Hi everyone,
I have a little bit of complicated task to finish with AWK. Here it is;
I have a data file in xml format which looks like this
<data>
a1 a2 a3 a4 a5
b1 b2 b3 b4 b5
c1 c2 c3 c4 c5
d1 d2 d3 d4 d5
e1 e2 e3 e4 e5
</data>
lets say each data block contains 5 rows and 5 columns,... (13 Replies)
Discussion started by: hayreter
13 Replies
LEARN ABOUT MOJAVE
net::dns::rr::gpos5.18
Net::DNS::RR::GPOS(3) User Contributed Perl Documentation Net::DNS::RR::GPOS(3)NAME
Net::DNS::RR::GPOS - DNS GPOS resource record
SYNOPSIS
use Net::DNS;
$rr = new Net::DNS::RR('name GPOS latitude longitude altitude');
DESCRIPTION
Class for DNS Geographical Position (GPOS) 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.
latitude
$latitude = $rr->latitude;
$rr->latitude( $latitude );
Text string representing latitude as a floating-point number.
longitude
$longitude = $rr->longitude;
$rr->longitude( $longitude );
Text string representing longitude as a floating-point number.
altitude
$altitude = $rr->altitude;
$rr->altitude( $altitude );
Text string representing altitude as a floating-point number.
COPYRIGHT
Copyright (c)1997-1998 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, RFC1712
perl v5.18.2 2014-01-16 Net::DNS::RR::GPOS(3)