I have a generic data-extraction script for xml which often works nicely for repeated XML/HTML structures as long as there isn't things with spaces inside tag attributes. It prints everything in a tabular way so you can filter and rearrange as you please afterwards.
The DEP variable controls how many close-tags in a row it looks for before printing a row of data. Set it as high as you can while still having it printing what you want. In this case, that seems to be 4.
Last edited by Corona688; 08-28-2012 at 03:00 PM..
Anyone have a better idea to automate extraction of info like ...
"uname"
"ifconfig"
"ps efl"
"netstat -ao"
etc.
from several hundred aix, solaris, red hat boxes? without logging into each box and manually performing these tasks and dumping them to individual files?
thanks for any input (1 Reply)
Hi,
I hope this is appropriate for this forum.
I have a text file (test.txt) that contains information that I would like to parse into an IDL procedure. Each line of the text file is either a number or a string, which will be a variable in my IDL procedure. Therefore I want to read each line... (1 Reply)
needa c program to extract text between two delimiters from some text file.
and then storing them in to diffrent variables ?
text file like 0:
abc.txt
=========
aaaaaa|11111111|sssssssssss|333333|ddddddddd|34343454564|asass
aaaaaa|11111111|sssssssssss|333333|ddddddddd|34343454564|asass... (7 Replies)
Dear all
I have a file call interfaces.txt
Filename: interfaces.txt
How can I extract the information at below?
ABC_DB_001 hostname1 20901
ABC_DB_002 hostname2 20903
ABC_DB_003 hostname3 20905
Currently I am using a very stupid method
grep ^ABC interfaces.txt > name.txt
grep... (3 Replies)
Looking for a shell script or a simple perl script . I am new to scripting and not very good at it .
I have 2 directories . One of them holds a text file with list of files in it and the second one is a daily log which shows the file completion time. I need to co-relate both and make a report.
... (0 Replies)
Hi Folks,
I've searched for this for quite a while, but can't find any solution - hope someone can help.
I have various files with standard headers. eg.
<HEADER>
IP: 1.2.3.4
Username: Joe
Time: 12:00:00
Date: 23/05/2010
</HEADER>
This
is
a
test
and this part can be any size... (6 Replies)
Hi All,
Do anyone of you have any idea how to extract each<info> tag to each different file. I have 1000 raw files, which come in every 15 mins.( I am using bash)
I have tried my script as below, but it took hours to finish, which is inefficiency.
perl -n -e '/^<info>/ and open FH,">file".$n++;... (2 Replies)
Hello,
Thank you in advance for helping a newbie who is having great trouble with this simple task.
I'm allowed to copy one file remotely each night due to bandwidth restrictions.
A new file gets generated once a day, and I need to copy the previous day's file.
Here is what I'd like to do:... (1 Reply)
I have a LOG file which looks like this
Import started at: Mon Jul 23 02:13:01 EDT 2012
Initialization completed in 2.146 seconds.
--------------------------------------------------------------------------------
--
Import summary for Import item: PolicyInformation... (8 Replies)
Hi guys, new to this forum. I am currently trying to extract the times from pinging a domain and list the top 3 and then also do the opposite i.e. list the bottom 3.
so if I had this as a ping result (the bold part is what I want):
64 bytes from 193.120.166.90: icmp_seq=10 ttl=128 time=34.8... (5 Replies)
Discussion started by: acoding
5 Replies
LEARN ABOUT DEBIAN
bio::ontologyio::handlers::basesaxhandler
Bio::OntologyIO::Handlers::BaseSAXHandler(3pm) User Contributed Perl Documentation Bio::OntologyIO::Handlers::BaseSAXHandler(3pm)NAME
Bio::OntologyIO::Handlers::BaseSAXHandler base class for SAX Handlers
SYNOPSIS
See description.
DESCRIPTION
This module is an abstract module, serving as the base of any SAX Handler implementation. It tries to offer the framework that SAX handlers
generally need, such as tag_stack, char_store, etc.
In the implementation handler, you can take advantage of this based module by the following suggestions.
1) In start_element,
sub start_element {
my $self=shift;
my $tag=$_[0]->{Name};
my %args=%{$_[0]->{Attributes}};
# Your code here.
# Before you conclude the method, write these 2 line.
$self->_visited_count_inc($tag);
$self->_push_tag($tag);
}
2) In end_element,
sub end_element {
my $self=shift;
my $tag=shift->{Name};
# Your code here.
# Before you conclude the method, write these 2 lines.
$self->_visited_count_dec($tag);
$self->_pop_tag;
}
3) In characters, or any other methods where you may use the tag stack or count
sub characters {
my $self=shift;
my $text=shift->{Data};
$self->_chars_hash->{$self->_top_tag} .= $text;
}
$count = $self->_visited_count('myTag');
$tag = $self->_top_tag;
FEEDBACK
Mailing Lists
User feedback is an integral part of the evolution of this and other Bioperl modules. Send your comments and suggestions preferably to one
of the Bioperl mailing lists.
Your participation is much appreciated.
bioperl-l@bioperl.org - General discussion
http://bioperl.org/wiki/Mailing_lists - About the mailing lists
Support
Please direct usage questions or support issues to the mailing list:
bioperl-l@bioperl.org
rather than to the module maintainer directly. Many experienced and reponsive experts will be able look at the problem and quickly address
it. Please include a thorough description of the problem with code and data examples if at all possible.
Reporting Bugs
Report bugs to the Bioperl bug tracking system to help us keep track the bugs and their resolution. Bug reports can be submitted via the
web:
https://redmine.open-bio.org/projects/bioperl/
AUTHOR
Juguang Xiao, juguang@tll.org.sg
APPENDIX
The rest of the documentation details each of the object methods. Interal methods are usually preceded with a _
_tag_stack
Title : _tag_stack
Usage : @tags = $self->_tag_stack;
Function: Get an array of tags that have been accessed but not enclosed.
Return :
Args :
_push_tag
_pop_tag
_top_tag
Title : _top_tag
Usage : $top = $self->_top_tag;
Function: get the top tag in the tag stack.
Return : a tag name
Args : [none]
_chars_hash
Title : _chars_hash
Usage : $hash= $self->_chars_hash;
Function: return the character cache for the specific tag
Return : a hash reference, which is intent for character storage for tags
Args : [none]
_current_hash
_visited_count_inc
Title : _vistied_count_inc
Usage : $self->vistied_count_inc($tag); # the counter for the tag increase
Function: the counter for the tag increase
Return : the current count after this increment
Args : the tag name [scalar]
_visited_count_dec
Title : _visited_count_dec
Usage : $self->_visited_count_dec($tag);
Function: the counter for the tag decreases by one
Return : the current count for the specific tag after the decrement
Args : the tag name [scalar]
_visited_count
Title : _visited_count
Usage : $count = $self->_visited_count
Function: return the counter for the tag
Return : the current counter for the specific tag
Args : the tag name [scalar]
perl v5.14.2 2012-03-02 Bio::OntologyIO::Handlers::BaseSAXHandler(3pm)