I have files on my AIX 4.2 client system where I need to do the following replacements below but have no clue how ? They are control characters (linefeed, chariage return, ...).
First, replace "^M^Y^M" with ^char_for_end_of_line
Then replace "^M" with " "
Trim all left spaces
In VI, my... (7 Replies)
Hello,
I have searched forum trying to find a solution to my problem, but could not find anything or I did not understand the examples....
I should say, I am very inexperienced with text processing.
I have a text file with approx 60k lines in it.
I need to merge lines based on the number... (8 Replies)
i am editing a big log file with the following pattern:
Date: xxxx Updated: name
Some log file text here
Date: eee Updated: ny
Some log file text here
Basically i want to remove all the text in a line before the "Updated" pattern. I sill want to print the other... (4 Replies)
Hey folks!
I am new to shell-scripting, but I have a problem that I would like to solve using a script. I create very large html forms, used for randomized trials. In these forms, each question is supplied with a variable that looks something like this: PROJECT_formNN
Where NN is the question... (1 Reply)
I have a sample text format as given below
<Text Text_ID="10155645315851111_10155645333076543" From="460350337461111" Created="2011-03-16T17:05:37+0000" use_count="123">This is the first text</Text>
<Text Text_ID="10155645315851111_10155645317023456" From="1626711840902323"... (3 Replies)
i have a file which contains data seperated by comma. i want to replace text after 3rd occurrence of a comma.
the input file looks like this
abcdef,11/02/2015 11:55:47,1001,1234567812345678,12364,,abc
abcdefg,11/02/2015 11:55:47,01,1234567812345678,123,,abc
abcdefhih,11/02/2015... (4 Replies)
hi unix expert
is there any command in linux to repace a pattern in the text to another pattern?
many thanks
samad (2 Replies)
Discussion started by: abdossamad2003
2 Replies
LEARN ABOUT DEBIAN
xml::libxml::pattern
XML::LibXML::Pattern(3pm) User Contributed Perl Documentation XML::LibXML::Pattern(3pm)NAME
XML::LibXML::Pattern - XML::LibXML::Pattern - interface to libxml2 XPath patterns
SYNOPSIS
use XML::LibXML;
my $pattern = XML::LibXML::Pattern->new('/x:html/x:body//x:div', { 'x' => 'http://www.w3.org/1999/xhtml' });
# test a match on an XML::LibXML::Node $node
if ($pattern->matchesNode($node)) { ... }
# or on an XML::LibXML::Reader
if ($reader->matchesPattern($pattern)) { ... }
# or skip reading all nodes that do not match
print $reader->nodePath while $reader->nextPatternMatch($pattern);
$pattern = XML::LibXML::Pattern->new( pattern, { prefix => namespace_URI, ... } );
$bool = $pattern->matchesNode($node);
DESCRIPTION
This is a perl interface to libxml2's pattern matching support http://xmlsoft.org/html/libxml-pattern.html. This feature requires recent
versions of libxml2.
Patterns are a small subset of XPath language, which is limited to (disjunctions of) location paths involving the child and descendant axes
in abbreviated form as described by the extended BNF given below:
Selector ::= Path ( '|' Path )*
Path ::= ('.//' | '//' | '/' )? Step ( '/' Step )*
Step ::= '.' | NameTest
NameTest ::= QName | '*' | NCName ':' '*'
For readability, whitespace may be used in selector XPath expressions even though not explicitly allowed by the grammar: whitespace may be
freely added within patterns before or after any token, where
token ::= '.' | '/' | '//' | '|' | NameTest
Note that no predicates or attribute tests are allowed.
Patterns are particularly useful for stream parsing provided via the "XML::LibXML::Reader" interface.
new()
$pattern = XML::LibXML::Pattern->new( pattern, { prefix => namespace_URI, ... } );
The constructor of a pattern takes a pattern expression (as described by the BNF grammar above) and an optional HASH reference mapping
prefixes to namespace URIs. The method returns a compiled pattern object.
Note that if the document has a default namespace, it must still be given an prefix in order to be matched (as demanded by the XPath
1.0 specification). For example, to match an element "<a xmlns="http://foo.bar"</a>", one should use a pattern like this:
$pattern = XML::LibXML::Pattern->new( 'foo:a', { foo => 'http://foo.bar' });
matchesNode($node)
$bool = $pattern->matchesNode($node);
Given an XML::LibXML::Node object, returns a true value if the node is matched by the compiled pattern expression.
SEE ALSO
XML::LibXML::Reader for other methods involving compiled patterns.
AUTHORS
Matt Sergeant, Christian Glahn, Petr Pajas
VERSION
2.0001
COPYRIGHT
2001-2007, AxKit.com Ltd.
2002-2006, Christian Glahn.
2006-2009, Petr Pajas.
perl v5.14.2 2012-06-20 XML::LibXML::Pattern(3pm)