- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: PERL script to parse
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
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
07-24-2008 09:06 AM
07-24-2008 09:06 AM
I have attached one report file.the output pattern also i have attached.I want to parse the starting location values & corresponding % cpu Solo time.
Can anyone please help in this regard?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-24-2008 09:51 AM
07-24-2008 09:51 AM
SolutionThat zip file is small and unuseable (for me).
Maybe just attach a simple .txt file with a good chunk of input data and some sample output.
'starting location' and 'Solo' time do not mean much to me now, but might become clear if the data had been readable.
Please show us how far you got with trying to solve this, or send money for us to do all your work
hth,
Hein.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-24-2008 09:52 AM
07-24-2008 09:52 AM
Re: PERL script to parse
It seems that this file (attachment) is corrupt. At least, I can't open it.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-24-2008 10:00 AM
07-24-2008 10:00 AM
Re: PERL script to parse
I am attaching it again.
I have used awk $3 inputfile>output
but the output is not comin properly.I think some column mismatch is also happening.So asking for your help.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-24-2008 10:09 AM
07-24-2008 10:09 AM
Re: PERL script to parse
> me).
It is small, but I had no trouble with it.
(Mozilla/5.0 (X11; U; OpenVMS
COMPAQ_Professional_Workstation; en-US;
rv:1.7.13) Gecko/20060506 + UnZip 5.52).
Perhaps you live wrong.
alp $ unzip -t 308587.ZIP
Archive: ALP$DKA0:[SMS.ITRC]308587.ZIP;1
testing: New Folder/Input file.txt OK
testing: New Folder/output.xls OK
testing: New Folder/ OK
No errors detected in compressed data of ALP$DKA0:[SMS.ITRC]308587.ZIP;1.
The ".xls" file was pretty useless to me, of
course.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-24-2008 10:32 AM
07-24-2008 10:32 AM
Re: PERL script to parse
Perhaps:
# perl -ne 'next if m{^\s*$};@a=split;next unless $a[0]=~m{[0-9A-F]+} && $a[2]=~m{\d*\.\d+} && printf "%s %s\n",$a[0],$a[2]' file
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-24-2008 10:33 AM
07-24-2008 10:33 AM
Re: PERL script to parse
but can you help in that script?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-24-2008 10:57 AM
07-24-2008 10:57 AM
Re: PERL script to parse
JRF choose for a solution where he skips (next) lines if they do not match.
I prefer to look for what I need:
$ perl -lne 'print qq($1 $2) if /^\s+([0-9A-F]{6})\s+\d+\s+([0-9.]+)/' file
Regular expression par # explanaiton
^\s+ # a line starting with some whitespace
([0-9A-F]{6}) # and 6 hex character (remember in $1)
\s+\d+\s+ #followed by whitespace, number, whitesdpace
([0-9.]+) # and finally some numbers or dots, remembered in $2.
If the line matches that, then print those $1 and $2 remembered.
hth,
Hein.