Oh, I don't know if it matters but I'm doing all of this in DOS.
When I type:
awk '/Availability|Reboots/,/Bluescreens/' file.txt
I get an error message saying:
'Reboots' is not recognized as an internal or external command, operable program or batch file.
awk : not enough arugments
Any...
Ok I want to awk certain parts of a file based on whether or not they have certain words. I'll post an example of my file.
**********************
Server1
**********************
Current System Uptime " 6 day(s), 21 hour(s), 13 minute(s), 35 second(s)"...
Actually, I just did some more tests on it and no. for some reason it seems to merge them into the middle of each other. Also, with some of the files, it won't work. Could it be because of the file name or the contents of the file itself?
awk '
/executions/{ E = $NF }
/compilations/ { C = $NF }
/deleted/ { A[++i] = sprintf("%10s%10s%10s", E, C, $NF) }
END { for (; i > 0; i--) print A[i] | \
"sort -r -k" COL "," COL }' COL=1 file
That's an example i found that I tried to implement into my code, but with my little awk experience I...
I've seen something like this in other places but I'm extremely new to using awk and couldn't make any sense of it. Could someone please tell me how to get this:
System Availability 100.00%
Total Uptime 551d 8h 12m 23s
Total Downtime 0d 0h 24m...
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.