Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  • Users: Kipnep70
  • Content: Threads
  • Order by date
  1. Kipnep70

    Help converting list of strings to Object

    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...
  2. Kipnep70

    Help with parsing data

    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...
  3. Kipnep70

    removing duplicate lines depending on value of $1

    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...
  4. Kipnep70

    Help parsing data in sets

    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...
  5. Kipnep70

    Sort Help Request

    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...
  6. Kipnep70

    help modify last character in last line

    Using BladeLogic NSH (Simliar to ZSH)... System Variables: x=myserver y=myfile awk 'BEGIN{OFS=","}{if (NR < 2) print "\042""'"$x"'""\042","\042""'"$y"'""\042","\042"$0; else print $0}END{print "\042"" ^ENDOFRECORD^"}' //${x}//usr/openv/netbackup/${y} >> //myserver/tmp/inprogress/exclude.final...
  7. Kipnep70

    Combining Awk programs

    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...
  8. Kipnep70

    Filtering data

    My input looks like the following: Device Name : "/dev/rmt/c56t0d0BESTnb" Passthru Name: "/dev/sctl/c56t0l0" Volume Header: "" Port: -1; Bus: -1; Target: -1; LUN: -1 Inquiry : "HP Ultrium 3-SCSI M66S" Vendor ID : "HP " Product ID : "Ultrium 3-SCSI " Product Rev: "M66S" Serial...
  9. Kipnep70

    Please explain following awk

    I know what it does.. but I don't understand the syntax: awk '!x[$0]++' How does this remove duplicate lines out of a file?
  10. Kipnep70

    Help Printing decimal with mixed fields

    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...
  11. Kipnep70

    req: please review one-liner

    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...
  12. Kipnep70

    Need to clean this up

    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...
  13. Kipnep70

    Is there a way to shorten this awk program ...

    Just wondering, Can this be simplified? awk -F "," 'BEGIN {a=0} $3==1 && $21==1 {a++} END{print a}'
  14. Kipnep70

    Looking for guidance (correlation)

    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...
  15. Kipnep70

    Can this be shortened?

    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
  16. Kipnep70

    Comparing multiline records

    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...
  17. Kipnep70

    Request Help w/awk script that sorts

    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) {...
  18. Kipnep70

    shell command on awk variable -- help

    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...
  19. Kipnep70

    REQ: Help use table to lookup values

    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...
  20. Kipnep70

    Question about file lists / impact on cpu

    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...

Part and Inventory Search

Back
Top