Hello.
I'm hoping somebody could help me figure out the following.
I have data that I've pulled down from a website using invoke-webrequest. I've got the data cleaned up and now is in an system.string type object. I want to create a hash table and possibly convert to a pscustomobject, but...
My data looks like the following:
id 34
name SERVERABC
port_count 2
type generic
mask 1111111111111111111111111111111111111111111111111111111111111111
iogrp_count 4
status online
site_id
site_name
host_cluster_id
host_cluster_name
WWPN 5001438002A3005A
node_logged_in_count 8
state active
WWPN...
I have a file that looks like this:
apple4 yellow
apple1 red
apple6 blue
apple3 green
grape red
grape purple
apple68 yellow
apple32 red
apple98 orange
grape yellow
I would like to remove duplicate lines using the following:
awk '!x[$2]++'
However I only want to remove duplicates if $1...
Wondering if anybody could help...
I've clipped some of the raw data, but you'll get the general idea.
Raw data:
CL1-A
CL1-A
CL1-A
CL1-A
CL1-A
CL1-A
CL1-A
CL1-A
CL1-A
CL1-A
CL1-B
CL1-B
CL1-B
CL1-B
CL1-B
CL1-B
CL1-B
CL1-B
CL1-B
CL1-B
CL1-B
CL1-B
CL1-B
CL1-B
CL1-B...
This is the type of data I'm working with:
GUEST
DN: apple
DS: G-WE01-E20A-SLS-4
DS: G-WE01-E203-SLS-4
GUEST
DN: grape
DS: G-WE01-E20B-SLS-4
GUEST
DN: banana
DS: G-WE01-E20A-SLS-4
DS: G-WE01-E200-SLS-4
I have two records here, the "GUEST" line I can use as my record separator.
Basically I'd...
I have a script that uses several awk one liners to manipulate data. Does it make sense to have several awk programs in one shell script, or is it always possible to combine the awk programs?
Example:
#Running bperror to get data
/usr/openv/netbackup/bin/admincmd/bperror -backstat -l -d...
I have a line that looks like this:
Jane likes math 13
My awk program:
awk '{print $1, $2, $3/14}'
Results:
Jane likes 0
Desired:
Jane likes 0.21
I was playing with the printf command but I can't get it to print both numbers and words out.
# echo "40052.96 hello" |awk '{printf...
I've written a one-liner and it is producing the results I want, but I'm not confident that it is written correctly.
I'm trying to print the first field of each record and omit the last line of a file.
cat clients | awk '{a=0; if (a > $NF) print $1}'
Then I realized that $NF represents the...
Can somebody clean my command line up a little bit.
The text I want to maniuplate comes from an output of a command:
Master;HP-UX-IA64, HP-UX11.23;6.5.3;NetBackup;6.5;650000;/usr/openv/netbackup/bin;HP-UX B.11.23 ;
6.5.3.1
I'm trying to get it all on one line. I want to keep the ";" as...
Here what I'm trying to do:
I have one file that has the following:
F001AE50C1 ADIC1_5_3_1_51 51 server1
F001AE5133 ADIC1_5_3_1_52 52 server1
F001AE5139 ADIC1_5_4_2_53 53 server1
F001AE513F ADIC1_5_4_2_54 54 server1
I have another file that looks...
I've written a one-liner that will search for pattern in a file and then print the total lines that a match was found on.
awk '/HCART/ && !/NONE/ { $0=a++ }; END{ print a }'
Basically I was just trying to avoid 'wc -l' for fun. Is there a better way to do this?
Thanks
Is awk capable of comparing a multilined record to a baseline record and outputing the difference?
For example..
Record 1 (Base line)
--------------
Name: Joseph Smith
Phone: 555-555-1234
Address: 801 Somewhere Ln.
Schedule: 08:00 - 17:00
----------------
Record 2
--------------
Name...
I use the following awk script to create 5 columns out of a single column:
BEGIN {
count=0
cols=5
}
{
len=length($0)
pad=substr(" ",1,15-len)
LINE=LINE " " $0 pad
count=count+1
if (count == cols) {
print LINE
count=0
LINE=""
}
}
END { if (count > 0) {...
My awk script:
bpimagelist -l -d 12/12/2007 -M uhilhr03 | grep ^IMAGE | awk 'BEGIN {OFS=":"}{print $2, $11, $20, $19}'
I would like to take variable $19 and run the following shell command on it:
bpdbm -ctime $19
Then plug that ouput back into my awk program and get the results ... is...
I have one file that looks like this:
0,9840_10
1,9840_12
2,9840_9
3,9940_3
4,9840_11
..
..
I also have another file like this:
2007-11-06 07:50:03 Drive #13 is DOWN-TLD on server.
2007-11-06 07:50:07 Drive #4 is DOWN-TLD on server.
2007-11-06 07:50:10 Drive #15 is DOWN-TLD on server...
I have about 325 servers (a mixture of windows, HP, and solaris).
I'm planning on using ALL_LOCAL_DRIVES and 'cross all mount points' for backing up each server. They will all have exclude lists as well.
How much more "work" is my master going to have to process? Can I expect backups to...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.