Trying to use awk to format the input based on the filed count being 5. Most lines are fine using the awk below, except the first two lines. I know the reason is the -1 in green and -2 in blue. But can not figure out how to not split on the - if it is followed by a digit then letter. Thank you .
I have the file with the records like
4234234 US phone
3244234 US cup
2342342 CA phone
8947234 US phone
2389472 CA cup
2348972 US maps
3894234 CA phone
I want the records with (US,phone) as record to be in one file, (Us, cup) in another file and (CA,cup) to be in another
I mean all... (12 Replies)
hi ,
I have a String str="/opt/ibm/lotus/ibw/latest" or ="/opt/lotus/ibw/latest" this value is dynamic..I want to split this string into 2 strings
1. /opt/ibm/lotus(/opt/lotus) this string must ends with "lotus"
2./ibw/latest
can any body help me on this?
Regards,
sankar (2 Replies)
$ cat file
H1:12:90
k:12:b
n:22:i
k:54:b
k:42:b
s:48:s
a:41:b
t:18:n
c:77:a
I am trying to split above file based on $2 such that if $2 is rounded to nearest 10's multiple (e.g. 10,20,30 etc), each sub file should contain 3 multiples and so on (also I want to keep header i.e. NR==1, in... (6 Replies)
Below is the code
nawk -F"|" 'tolower($1) ~ "abc" |"" {if (tolower($2) ~"abc"|"") print$0}' file
I want the records from file whose 1st and 2nd field should be either "abc" or "null"
I tried but its giving error.
Appreciate help (2 Replies)
Hi all,
I have a file which I want to split into several files based on a condition. This files has several records. I want one record per file. Each record ends with a //. So, I want to separate files based on this condition. I want split files to be named with the name across the field ID (for... (2 Replies)
In the tab delimited files below I am trying to match $2 in file1 to $2 of file2. If a match is found the awk checks $3 of file2 and if it is greater than 40% and $4 of file2 is greater than 49, the line in file1 is printed. In the desired output line3 of file1 is not printed because $3 off file2... (9 Replies)
I am trying to modify and understand an awk written by @Scrutinizer
The below awk will filter a list of 30,000 lines in the tab-delimited file. What I am having trouble with is adding a condition to SVTYPE=CNV
that will only print that line if CI=,0.95: portion in blue in file is <1.9.
The... (2 Replies)
In the awk below I am trying to print only the header lines starting with # or ## and the lines that $7 is PASS and AF= is less than 5%. The awk does execute but returns an empty file and I am not sure what I am doing wrong. Thank you.
file
... (0 Replies)
I am trying to use awk to print lines that satisfy either of the two conditions below:
condition 1: $2 equals CNV and the split of $3, the value in red, is greater than or equal to 4. ---- this is a or so I think
condition 2: $2 equals CNV and the split of $3, the value in red --- this is a... (4 Replies)
Discussion started by: cmccabe
4 Replies
LEARN ABOUT REDHAT
newapc
NEWAPC(8) Network UPS Tools (NUT) NEWAPC(8)NAME
newapc - Driver for American Power Conversion Smart Protocol UPS equipment
NOTE
This man page only documents the hardware-specific features of the newapc driver. For information about the core driver, see nutupsdrv(8).
SUPPORTED HARDWARE
newapc should recognize all recent APC models that use a serial protocol at 2400 bps. This is primarily the Smart-UPS, Matrix-UPS and
Back-UPS Pro lines. Older APC models may work better with the apcsmart driver.
The driver attempts to support every bell and whistle of the APC reporting interface, whether or not this is strictly sensible.
Some older hardware may only report a handful of variables. This is usually not a bug - they just don't support anything else.
CABLING
This driver expects to see a 940-0024C cable or a clone by default. You can switch to the 940-0095B dual-mode cable support with the
cable= definition described below.
If your 940-0024C cable is broken or missing, use this diagram to build a clone:
http://www.exploits.org/nut/library/cables/940-0024C.jpg
EXTRA ARGUMENTS
This driver supports the following optional settings in the ups.conf(5):
cable=940-0095B
Configure the serial port for the APC 940-0095B dual-mode cable.
sdtype=num
Use shutdown type num, according to this table:
0: soft shutdown or powerdown, depending on battery status
1: soft shutdown followed by powerdown
2: instant power off
3: power off with grace period
Modes 0 and 1 will power up the load when power returns. Modes 2 and 3 will keep the load turned off when the power returns.
BUGS
Some older APC UPS models return bogus data in the status register during a front panel test. This is usually detected and discarded, but
some other unexpected values have occasionally slipped through.
AUTHOR
Nigel Metheringham <Nigel.Metheringham@Intechnology.co.uk> (drawing heavily on the apcsmart driver by Russell Kroll).
SEE ALSO
The core driver:
nutupsdrv(8)
The apcsmart driver:
apcsmart(8)
Internet resources:
The NUT (Network UPS Tools) home page: http://www.exploits.org/nut/
NUT mailing list archives and information: http://lists.exploits.org/
Tue Oct 22 2002 NEWAPC(8)