HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Parsing File line 1, 2, 3, 4 (repeating) into fiel...
Operating System - HP-UX
1833827
Members
2062
Online
110063
Solutions
Forums
Categories
Company
Local Language
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
back
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Go to solution
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-17-2003 01:49 AM
10-17-2003 01:49 AM
I'm trying to get Clay's awk program to work for me for similar reasons as in the thread:
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=100049
I'm lookin into writing some scripts which give me a webpage that is updated daily. It'll list the backups, with red/green,etc along each one. Then for each backup session, you can click on a hotlink to open a page which shows the full session messages from "omnidb -session xxxx/xx/xxx -report" and maybe another hotlink to see which tape it wrote to. I'll probably integrate this with our BigBrother setup.
Anyway, attached is the output from when I ran the awk script like above:
omnidb -rpt | tail -50 | awk -f parse.awk
parse.awk says:
BEGIN {
prev2=""
prev1=""
}
{
printf("%s\t%s\t%s\n",prev2,prev1,$0)
}
prev2 = prev1
prev1 = $0
Instead of "rogress" for in progress, I need everything.
Cheers Heroes!
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=100049
I'm lookin into writing some scripts which give me a webpage that is updated daily. It'll list the backups, with red/green,etc along each one. Then for each backup session, you can click on a hotlink to open a page which shows the full session messages from "omnidb -session xxxx/xx/xxx -report" and maybe another hotlink to see which tape it wrote to. I'll probably integrate this with our BigBrother setup.
Anyway, attached is the output from when I ran the awk script like above:
omnidb -rpt | tail -50 | awk -f parse.awk
parse.awk says:
BEGIN {
prev2=""
prev1=""
}
{
printf("%s\t%s\t%s\n",prev2,prev1,$0)
}
prev2 = prev1
prev1 = $0
Instead of "rogress" for in progress, I need everything.
Cheers Heroes!
Solved! Go to Solution.
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-17-2003 02:06 AM
10-17-2003 02:06 AM
Solution
The problem is that the check in rogress resulted in not every line being printed. But what you could do is something like this:
BEGIN { prev1="";prev2="";prev3="" }
{
if (NF < 1) {
if (prev1 != "") {
printf("%s\t%s\t%s\n",prev3,prev2,prev1);
}
prev3="";
prev2="";
prev1="";
} else {
prev3=prev2;
prev2=prev1;
prev1=$0;
}
}
BEGIN { prev1="";prev2="";prev3="" }
{
if (NF < 1) {
if (prev1 != "") {
printf("%s\t%s\t%s\n",prev3,prev2,prev1);
}
prev3="";
prev2="";
prev1="";
} else {
prev3=prev2;
prev2=prev1;
prev1=$0;
}
}
Every problem has at least one solution. Only some solutions are harder to find.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-17-2003 02:08 AM
10-17-2003 02:08 AM
Re: Parsing File line 1, 2, 3, 4 (repeating) into field1, field2, field3 via awk
The original script contains a pattern, which if matched, prints out that line and the 2 preceding, with tabs between each.
You have taken out the pattern, so for every line in the source, you are getting the line and the 2 preceding.
I don't have omnidb, so I don't know your input format, but I hope that explains what you are seeing.
When you say you need "everything", what patterns does this represent?
-- Graham
You have taken out the pattern, so for every line in the source, you are getting the line and the 2 preceding.
I don't have omnidb, so I don't know your input format, but I hope that explains what you are seeing.
When you say you need "everything", what patterns does this represent?
-- Graham
Computers make it easier to do a lot of things, but most of the things they make it easier to do don't need to be done.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-17-2003 02:23 AM
10-17-2003 02:23 AM
Re: Parsing File line 1, 2, 3, 4 (repeating) into field1, field2, field3 via awk
G: thanks, that makes perfect sense as to why I was getting garbage (dd if=garbage of=garbage)
K: cheers, I've taken your great awk script and added two more variables/fields and now I have exactly what I want! I'll add that to my armory of awk scripts (which I understand enough to use, not explain) and I'll crack on with My BigBrother/OmniBack integration!
thanks loads!
K: cheers, I've taken your great awk script and added two more variables/fields and now I have exactly what I want! I'll add that to my armory of awk scripts (which I understand enough to use, not explain) and I'll crack on with My BigBrother/OmniBack integration!
thanks loads!
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Events and news
Customer resources
© Copyright 2025 Hewlett Packard Enterprise Development LP