Hello, was looking for some help on extracting a field from the passwd file.
So far I have made a copy of the passwd file and changed my rights so I can edit it. Every user's password is coded as an :x:, and my goal was to change that x to a blank, and then try to extract any user with that field... (2 Replies)
below are the contents of file 'tmp.out':
2|34|534|
1|355|54|
1|443|34|
3|43|768|
3|7|887|
1|9|990|
How do I extract the 2nd and 3rd columns of file 'tmp.out' only when the first column equals '1'.
Note that this file will be huge; atleast 5million+ rows, so I want to avoid looping... (4 Replies)
path = /first/second/third/fourth. i want to extract /first/second/third from path.my program something like this ....
path=/first/second/third/fourth
noc=`echo $path|tr '/' '\n'|wc -w`
var='echo $noc|cut -d'/' -f 1-$noc --> is giving error.
why $noc is not working here.any other... (3 Replies)
:confused: I have a tab delimited file that I need to extract data from and into a file with specific field specs. Each field has to be a certain amount of characters. So, the name field (from delimited file) might have only 15 characters but needs to be 25 (in new file) so I need to insert spaces... (5 Replies)
Hi,
Within a UNIX shell script I need to extract a value from an XML field. The field will contain different values but will always be 6 digits in length. E.g.:
<provider-id>999999</provider-id>
I've tried various ways but no luck. Any ideas how I might get the provider id (in this case... (2 Replies)
Hello Friends,
I have a file(InputFile.csv) with the following columns(the columns are pipe-delimited):
ColA|ColB|ColC|ColD|ColE|ColF
Now for this file, I have to get those records which fulfil the following condition:
If "ColB" is NOT NULL and "ColD" has values one of the following... (9 Replies)
I have a csv file that I need to extract some data from depending on another field after reading info from another text file.
The text file would say have 592560 in it.
The csv file may have some data like so
Field 1 Field2 Field3 Field4 Field5 Field6
20009756 1 ... (9 Replies)
Hi,
In my file (which is "," delimited and text qualifier is "), I have to extract a particualr field.
file1:
1,"aa,b",4
expected is the 2nd field:
aa,b
I tried the basic cut -d "," -f 2 file 1, this gave me
aa alone instead aa,b.
A small hint ot help on this will be very... (5 Replies)
Hi,
I have a file with colon separated values like below. How can i get those lines whose third field is 0 (zero). In the below example, lines starting with stapler and tempo has its third field as 0
$ cat list.txt
galaxy:b:5:world
stapler:a:0:hello
abc:a:4:stomper
kepler:uic:5:jam... (8 Replies)
Hi All,
I have records in unix file like below. In this file, we have empty fields from 4th Column to 22nd Column. I have some 200000 records in a file. I want to extract records only which have empty fields from 4th field to 22nd filed. This file is comma separated file. what is the unix... (2 Replies)
Discussion started by: rakeshp
2 Replies
LEARN ABOUT DEBIAN
xml::handler::subs
XML::Handler::Subs(3pm) User Contributed Perl Documentation XML::Handler::Subs(3pm)NAME
XML::Handler::Subs - a PerlSAX handler base class for calling user-defined subs
SYNOPSIS
use XML::Handler::Subs;
package MyHandlers;
use vars qw{ @ISA };
sub s_NAME { my ($self, $element) = @_ };
sub e_NAME { my ($self, $element) = @_ };
$self->{Names}; # an array of names
$self->{Nodes}; # an array of $element nodes
$handler = MyHandlers->new();
$self->in_element($name);
$self->within_element($name);
DESCRIPTION
"XML::Handler::Subs" is a base class for PerlSAX handlers. "XML::Handler::Subs" is subclassed to implement complete behavior and to add
element-specific handling.
Each time an element starts, a method by that name prefixed with `s_' is called with the element to be processed. Each time an element
ends, a method with that name prefixed with `e_' is called. Any special characters in the element name are replaced by underscores.
Subclassing XML::Handler::Subs in this way is similar to XML::Parser's Subs style.
XML::Handler::Subs maintains a stack of element names, `"$self-"{Names}', and a stack of element nodes, `"$self-"{Nodes}>' that can be used
by subclasses. The current element is pushed on the stacks before calling an element-name start method and popped off the stacks after
calling the element-name end method. The `"in_element()"' and `"within_element()"' calls use these stacks.
If the subclass implements `"start_document()"', `"end_document()"', `"start_element()"', and `"end_element()"', be sure to use `"SUPER::"'
to call the the superclass methods also. See perlobj(1) for details on SUPER::. `"SUPER::start_element()"' and `"SUPER::end_element()"'
return 1 if an element-name method is called, they return 0 if no method was called.
XML::Handler::Subs does not implement any other PerlSAX handlers.
XML::Handler::Subs supports the following methods:
new( OPTIONS )
A basic `"new()"' method. `"new()"' takes a list of key, value pairs or a hash and creates and returns a hash with those options; the
hash is blessed into the subclass.
in_element($name)
Returns true if `$name' is equal to the name of the innermost currently opened element.
within_element($name)
Returns the number of times the `$name' appears in Names.
AUTHOR
Ken MacLeod, ken@bitsko.slc.ut.us
SEE ALSO perl(1), PerlSAX.pod(3)perl v5.10.1 2003-10-21 XML::Handler::Subs(3pm)