I am new to scripting
I want to parse a string in a loop
eg A:B:C:D
E:F:G:H
and put them in different variable
attr1 = A
attr2 = B
attr3 = C
attr4 = D
.
.
/* do processing with attr1, attr2, attr3 and attr4 */
then go to next line E:F:G:H and again assign... (8 Replies)
I am having a text file as follows
say server.txt
Date Time server ip error code
--------------------------------------------------------------------------
02/21/2008 18:10:14 server1 xxx.xxx.xxx.xxx 6
02/21/2008 08:10:14 server2 ... (8 Replies)
Hello, i'm workig with a file with structural information about biological macromolecules (proteins etc).
In a certain file, the info is structured like this
@<TRIPOS>MOLECULE
blah 1
blah 2
blah 3
@<TRIPOS>MOLECULE
foo 1
foo 2
foo 3
@<TRIPOS>MOLECULE
mmm 1
mmm 2
mmm 3
I would... (7 Replies)
i need a simple text parser which can parse a data file created by a softwre so that i can export it to my mysqldb,, datafile created as one record per line with different number of fields.
e.g datafile contains following.
a=1, b=3, c=4
a=1, c=55, d=abcd
a=5, b=hello, c=99, d=help
now i... (12 Replies)
Hello
I want to write an xml- parser with perl an i use the libary XML::LibXML.
I have a problem with the command getElementsByTagName.
If there is an empty tag, the getElementsByTagName method returns a NodeList of length zero.
how can i check if this is a nodelist of lenght zero??
i... (1 Reply)
Hi,
I have this variable:
<a href="http://www.rtve.es/mediateca/videos/20100916/video-calamares-rellenos-salsa-pimientos-garbanzos-16-09-10/878586.shtml">V�deo: Calamares rellenos con salsa de pimientos y ...</a>
I would like to have:
... (7 Replies)
Hi Everyone
I have an out put of multiple lines
which I would like to parse and retrieve certain info from it.
The output consists of multiple sections that starts with the line Client:
and ends with STL tag: each section separated by an empty line.
So basically somehting like
Client: ... (10 Replies)
Hi
need help parsing a file.
I have tag fields and values in a file with delimiter |.
sample records from the file listed below
8=value|9=value|35=value|49=value|56=value|34=value|50=value|48=value|10=value
8=value|9=value|35=value|49=value|56=value|34=value|51=value|48=value|10=value... (2 Replies)
Hi,
I have been assigned a task to migrate few thousands of sql scripts to a different db format. there could be sub queries and complex joins. there would be functions that needs to be replaced from a given list to another values. this should also parse the sub\inline queries. Can you please... (1 Reply)
input
1..100km
112..403km
500..623km
required output
1..51
112..162
500..550
(i.e 50kms added to the initial distance) (2 Replies)
Discussion started by: ANKIT ROY
2 Replies
LEARN ABOUT MOJAVE
tap::parser::multiplexer
TAP::Parser::Multiplexer(3pm) Perl Programmers Reference Guide TAP::Parser::Multiplexer(3pm)NAME
TAP::Parser::Multiplexer - Multiplex multiple TAP::Parsers
VERSION
Version 3.26
SYNOPSIS
use TAP::Parser::Multiplexer;
my $mux = TAP::Parser::Multiplexer->new;
$mux->add( $parser1, $stash1 );
$mux->add( $parser2, $stash2 );
while ( my ( $parser, $stash, $result ) = $mux->next ) {
# do stuff
}
DESCRIPTION
"TAP::Parser::Multiplexer" gathers input from multiple TAP::Parsers. Internally it calls select on the input file handles for those
parsers to wait for one or more of them to have input available.
See TAP::Harness for an example of its use.
METHODS
Class Methods
"new"
my $mux = TAP::Parser::Multiplexer->new;
Returns a new "TAP::Parser::Multiplexer" object.
Instance Methods
"add"
$mux->add( $parser, $stash );
Add a TAP::Parser to the multiplexer. $stash is an optional opaque reference that will be returned from "next" along with the parser and
the next result.
"parsers"
my $count = $mux->parsers;
Returns the number of parsers. Parsers are removed from the multiplexer when their input is exhausted.
"next"
Return a result from the next available parser. Returns a list containing the parser from which the result came, the stash that corresponds
with that parser and the result.
my ( $parser, $stash, $result ) = $mux->next;
If $result is undefined the corresponding parser has reached the end of its input (and will automatically be removed from the multiplexer).
When all parsers are exhausted an empty list will be returned.
if ( my ( $parser, $stash, $result ) = $mux->next ) {
if ( ! defined $result ) {
# End of this parser
}
else {
# Process result
}
}
else {
# All parsers finished
}
See Also
TAP::Parser
TAP::Harness
perl v5.18.2 2014-01-06 TAP::Parser::Multiplexer(3pm)