- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- PERL for HTML file parsing
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
Discussions
Discussions
Discussions
Forums
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
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
тАО02-28-2007 08:31 PM
тАО02-28-2007 08:31 PM
Re: PERL for HTML file parsing
More of all it gives just values.
I see:
NHTEST
3848498958
NHTEST
1
10.2.0.2.0
NO
baloo_a
Begin Snap:
1728
02-Feb-07 20:00:35
20
3.1
All right, NHTEST - is the DB name, but what is for example 20? Is it Library Hit %? or Memory Usage %? You have values but you have no keys to them.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-28-2007 08:49 PM
тАО02-28-2007 08:49 PM
Re: PERL for HTML file parsing
if you run script so
./process_script report.html
it outputs data on console
if you run it so
./process_script report.html >> output.txt
OS sends output to file output.txt
if bracket is single (">") then output.txt get created if it doesnot exists and truncated if exists
if bracket is double (">>") then output.txt get created if it doesnot exists and appended if exists.
This is called output redirection.
so if you run
./process_script report1.html >> output.txt
./process_script report2.html >> output.txt
./process_script report3.html >> output.txt
.................
./process_script report100.html >> output.txt
then output.txt will contain 100 lines:
first line - output of ./process_script that parsed report1.html
second line - output of ./process_script that parsed report2.html
...
100th - output of ./process_script that parsed report100.html
try this:
echo a >> output.txt
echo b >> output.txt
echo c >> output.txt
And you will see that output.txt is created if it does not exists
And when you open this file you wiil see:
a
b
c
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-28-2007 08:53 PM
тАО02-28-2007 08:53 PM
Re: PERL for HTML file parsing
my scripyt is giving write output(i dnt require keys) but they are printed in next lines every time..but i need it in same line for any parameters..
can you help me in do that???
if i get that pattern then i can search my required parameter name from parsed text file with values
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-28-2007 08:57 PM
тАО02-28-2007 08:57 PM
Re: PERL for HTML file parsing
but i actually want seperate text files..then i have to compare any variable values from different text files
help me in doin that
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-28-2007 08:59 PM
тАО02-28-2007 08:59 PM
Re: PERL for HTML file parsing
sorry for not attaching before
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-28-2007 09:04 PM
тАО02-28-2007 09:04 PM
Re: PERL for HTML file parsing
$var="";
$var=$var.$value1;
$var=$var."\t".$value2;
$var=$var."\t".$value2;
..
$var=$var."\t".$value100;
print $var;
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-28-2007 09:05 PM
тАО02-28-2007 09:05 PM
Re: PERL for HTML file parsing
if output is as above then i can find "buffer cache" from the parsed text file and print the whole line...which in turn will give the required value of buffer cache..i will pass it to a different text file ,ie,called as "final.txt".
then i will do same operation on my 2nd text file..and so on
and every time i will send buffer cache values to "final.txt"
then i can compare all the buffer cahe values in 100 report files
like this i have to do comparison of all variables
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-28-2007 09:21 PM
тАО02-28-2007 09:21 PM
Solutionopen SRC, "$ARGV[0]";
$/= undef;
$data=
close SRC;
#take table string
$data =~ /$.*
$data = $&;
#get read of html
$data =~ s/
$data =~ s/
/\n/ig;
$data =~ s/<\/table>//ig;
$data =~ s///ig;
$data =~ s/><\/th>/>Column\t/ig;
$data =~ s/<\/th>/\t/ig;
$data =~ s/<\/TD><\/TR>//ig;
$data =~ s/<\/td>/\t/ig;
$data =~ s/<\/tr>//ig;
$data =~ s/
$data =~ s/
$data =~ s/\x20{2,}/\t/ig;
$data =~ s/ /\t/ig;
$data =~ s/\t{2,}/\t/ig;
print $data;
Save it to process.pl
and run
./process.pl your_report.html
Is it what you want?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-28-2007 09:49 PM
тАО02-28-2007 09:49 PM
Re: PERL for HTML file parsing
but i dont need the headings of the tables like "top 5 events",or table keys "event" "waits" "time(s)"
(it's ok...no prob if they are remaining there..but read below that if they are affecting or not the rest)...actually i need only table row values (see attached file)..every second variable values should go in next line(u can ignore this also).u can keep it as like as now also.
now let i have stored the values in a output1.txt file.similarly i will get 100 text files for 100 report files.
afterthat i need to get the value of "buffer hit" or "buffer cache" values from each of those 100 text files and redirect it to a file called "final.txt",ie,where it will be values of only buffer cache(or any other variables) recovered from 100 text files.then i can compare the values of buffercache values obtained from all report files.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-28-2007 09:54 PM
тАО02-28-2007 09:54 PM
Re: PERL for HTML file parsing
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-28-2007 09:59 PM
тАО02-28-2007 09:59 PM
Re: PERL for HTML file parsing
the last one or the before used script..and how???
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-28-2007 10:11 PM
тАО02-28-2007 10:11 PM
Re: PERL for HTML file parsing
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-28-2007 10:20 PM
тАО02-28-2007 10:20 PM
Re: PERL for HTML file parsing
open SRC, "$ARGV[0]";
$/= undef;
$data=
close SRC;
#take table string
$data =~ /$.*
$data = $&;
#get read of html
$data =~ s/
$data =~ s/
/\n/ig;
$data =~ s/<\/table>//ig;
$data =~ s///ig;
$data =~ s/><\/th>/>Column\t/ig;
$data =~ s/<\/th>/\t/ig;
$data =~ s/<\/TD><\/TR>//ig;
$data =~ s/<\/td>/\t/ig;
$data =~ s/<\/tr>//ig;
$data =~ s/
$data =~ s/
$data =~ s/\x20{2,}/\t/ig;
$data =~ s/ /\t/ig;
$data =~ s/\t{2,}/\t/ig;
print $data;
Save it to process.pl
and run
./process.pl your_report.html
this is your script...after running this it is giving output like this(attached)
now running everytime this script for html report i will get this type of output.
but i now i want to seperate out only single variable name(ie,buffer cache,redo size) with its values from different reports
i can't understand your last solution properly
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-28-2007 10:27 PM
тАО02-28-2007 10:27 PM
Re: PERL for HTML file parsing
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-28-2007 10:37 PM
тАО02-28-2007 10:37 PM
Re: PERL for HTML file parsing
Begin Snap: 1728 02-Feb-07 20:00:35 20 3.1
End Snap: 1729 02-Feb-07 21:00:35 23 3.7
Elapsed: 60.01 (mins)
DB Time: 0.27 (mins)
Buffer Cache: 5,984M 5,984M
but if it is this format then only i can find "buffer cache" and take the whole line out and then can compare...
can i print like this instead of printing as earlier(which looks same like the table).
pls tell me a solution pls...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-28-2007 11:59 PM
тАО02-28-2007 11:59 PM
Re: PERL for HTML file parsing
plss....help
- « Previous
-
- 1
- 2
- Next »