I have a file with "n" number of lines. I need to get rid of a specific line having a specific string from the file. I tried some possibilities but not successful.
For ex: in a file named "test"
hope should be removed along with the line.
ppl,
this is my "file" with fields
orderno orderdate orderdesc telno street city
1 01/04/2006 abc 123 100 tampa
2 01/04/2006 abc 123 100 tampa
3 01/04/2006 abc 123 100 tampa
4 01/04/2006 abc ... (2 Replies)
Hi all
Iam having a text file of records seperated by "SPACE"
and another text File of Records seperated by "TAB"
i'm writing a Generic code for Extracting Duplicate Records
Iam using "cut" Command to extract data.
How Can I Neglect Delimiter And write a generic code for all cases
... (4 Replies)
Dear All
I want to search string "1000" from input file and if it found i want remove line that contain 1000 and also remove 3 line above it and 2 line below it.
INPUT FILE:
BHAT-D 2
aaa
ID CODE GS UPDATE MODE LANG MCO MCL NUMPAGES
50 ... (7 Replies)
I have a file on UNIX system from where I want to grep the list of all users associated to the particular repository.If the user's list is in single line then I fetch all list but if it is in two separate lines it doesn't.I use the below command
a=KESTREL-DEV;b=users;cat access_file|grep... (1 Reply)
Hi All,
I have a csv file like the following:
"ABCD2","EFGH2","XXXX","1"
"ABCD2","EFGH2","XXXX","2"
I want to grep out the row which contains the value of 2 within the 4th column, so then i can use the extracted record to cut up and store into numerous variables.
Obviously when... (3 Replies)
Hello,
I know there are many questions and replies regarding grep command.
What I would like to do is a bit different.
File A:
hello world welcome to my page
this is my test site
how are you
I am fine, thank you
where have you been
I was in hospital
really hope you are fine now
Thanks,... (10 Replies)
Hello,
I have two files. All urls are space seperated.
source
http://xx.yy.zz http://df.ss.sd.xz http://09.09.090.01
http://11.22.33 http://canada.xx.yy http://01.02.03.04
http://33.44.55 http://98.87.76.65 http://russia.xx.zz
http://aa.tt.xx.zz http://1w.2e.3r.4t http://china.rr.tt
... (4 Replies)
Lets say I have a massive directory which is filled with other directories all filled with different c++ scripts and I want a listing of all the scripts that contain the string: "this string". Is there a way to use a grep search for that? I tried:
grep -lr "this string" *
but I do not... (3 Replies)
Discussion started by: Circuits
3 Replies
LEARN ABOUT DEBIAN
test::xml::xpath
Test::XML::XPath(3pm) User Contributed Perl Documentation Test::XML::XPath(3pm)NAME
Test::XML::XPath - Test XPath assertions
SYNOPSIS
use Test::XML::XPath tests => 3;
like_xpath( '<foo />', '/foo' ); # PASS
like_xpath( '<foo />', '/bar' ); # FAIL
unlike_xpath( '<foo />', '/bar' ); # PASS
is_xpath( '<foo>bar</foo>', '/foo', 'bar' ); # PASS
is_xpath( '<foo>bar</foo>', '/bar', 'foo' ); # FAIL
# More interesting examples of xpath assertions.
my $xml = '<foo attrib="1"><bish><bosh args="42">pub</bosh></bish></foo>';
# Do testing for attributes.
like_xpath( $xml, '/foo[@attrib="1"]' ); # PASS
# Find an element anywhere in the document.
like_xpath( $xml, '//bosh' ); # PASS
# Both.
like_xpath( $xml, '//bosh[@args="42"]' ); # PASS
DESCRIPTION
This module allows you to assert statements about your XML in the form of XPath statements. You can say that a piece of XML must contain
certain tags, with so-and-so attributes, etc. It will try to use any installed XPath module that it knows about. Currently, this means
XML::LibXML and XML::XPath, in that order.
NB: Normally in XPath processing, the statement occurs from a context node. In the case of like_xpath(), the context node will always be
the root node. In practice, this means that these two statements are identical:
# Absolute path.
like_xpath( '<foo/>', '/foo' );
# Path relative to root.
like_xpath( '<foo/>', 'foo' );
It's probably best to use absolute paths everywhere in order to keep things simple.
NB: Beware of specifying attributes. Because they use an @-sign, perl will complain about trying to interpolate arrays if you don't escape
them or use single quotes.
FUNCTIONS
like_xpath ( XML, XPATH [, NAME ] )
Assert that XML (a string containing XML) matches the statement XPATH. NAME is the name of the test.
Returns true or false depending upon test success.
unlike_xpath ( XML, XPATH [, NAME ] )
This is the reverse of like_xpath(). The test will only pass if XPATH does not generates any matches in XML.
Returns true or false depending upon test success.
is_xpath ( XML, XPATH, EXPECTED [, NAME ] )
Evaluates XPATH against XML, and pass the test if the is EXPECTED. Uses findvalue() internally.
Returns true or false depending upon test success.
set_xpath_processor ( CLASS )
Set the class name of the XPath processor used. It is up to you to ensure that this class is loaded.
In all cases, XML must be well formed, or the test will fail.
SEE ALSO
Test::XML.
XML::XPath, which is the basis for this module.
If you are not conversant with XPath, there are many tutorials available on the web. Google will point you at them. The first one that I
saw was: <http://www.zvon.org/xxl/XPathTutorial/>, which appears to offer interactive XPath as well as the tutorials.
AUTHOR
Dominic Mitchell <cpan2 (at) semantico.com>
COPYRIGHT AND LICENSE
Copyright 2002 by semantico
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
perl v5.14.2 2009-07-02 Test::XML::XPath(3pm)