- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Extracting lines from a canned report
Categories
Company
Local Language
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
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
Community
Resources
Forums
Blogs
- 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-08-2003 07:01 AM
10-08-2003 07:01 AM
Application : Smart
Call List : XYZABC
Totl Calls:
Avg time
Have attached a sample of the orginal report best to set you terminal to 132 characters. Can any of you guru's come up with a way to extract this information.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-08-2003 07:09 AM
10-08-2003 07:09 AM
Re: Extracting lines from a canned report
Take a look at the attached "Handy One-liners for Sed" (courtesy of Princess Paula). You'll find a section "# print section of file between two regular expressions (inclusive)"
That should do what you ask.
Pete
Pete
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-08-2003 07:47 AM
10-08-2003 07:47 AM
Re: Extracting lines from a canned report
Or, if you prefer awk you can try with a reursive function:
function aaa()
{
getline x
if (x !~ /Totl/)
{
print x
aaa()
}
else
print x
}
/Application/ { print; aaa() }
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-09-2003 12:10 AM
10-09-2003 12:10 AM
Re: Extracting lines from a canned report
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-09-2003 12:38 AM
10-09-2003 12:38 AM
Re: Extracting lines from a canned report
perl -n -e "next if not /Call List/;while(<>){exit if /Totl Calls/;print;}" testfile
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-09-2003 12:44 AM
10-09-2003 12:44 AM
Solution--
awk '
/^Application/
/^Call List/,/^Totl Calls/
/^Avg time/
' cannedfile
--
Isn't it ?
-- Graham