Hi
I want to get the value between to XML tags as follows
<EAN>12345</EAN>
so i would want to return 12345. i have tried sed and awk but can't do it.
can anyone help? (9 Replies)
I want to search the below XML pattern in the XML files, but the XML files would be in a .GZ files,
<PRODID>LCTO84876</PRODID>
<PARTNUMBER>8872AC1</PARTNUMBER>
<WWPRODID>MODEL84876</WWPRODID>
<COUNTRY>US</COUNTRY>
<LANGUAGE>1</LANGUAGE>
What's the command/script to search it ? :confused: (2 Replies)
I'm trying to use grep on XML files. The same grep expressions work on plaint text files but not on XML files (which of course are plain text files). Actually, these expressions work on XML files saved in DreamWeaver, but not when the same files are saved in XML Spy.
I want grep to treat these... (4 Replies)
Hi,
I would like to get rid of all comment in an xml file by grep or sed command:
The content seem like this:
<!-- ab cd
ef gh
ij kl -->
Anyone can help?
Thanks and Regards (3 Replies)
Hi, I need to grep a pattern and fetch subsequent lines till end of the data-set.
E.g., i have a file like:
AA 1111 23 34
BB 45 56 78
CC 22 44
AA 2222 78 34 56
BB 22 56 67 68 23
CC 56 78
DD 33 55 77
AA 3333 46
BB 58 79
In above file i have 3-data sets where each set starts with... (6 Replies)
Hi
i have a file which have a pattern like this
Nov 10 session closed
Nov 10 Nov 9 08:14:27 EST5EDT 2010 on tty .
Nov 10 Oct 19 02:14:21 EST5EDT 2010 on pts/tk .
Nov 10 afrtetryytr
Nov 10 session closed
Nov 10 Nov 10 03:21:04 EST5EDT 2010
Dec 8 Nov 10 05:03:02 EST5EDT 2010
... (13 Replies)
I have 2 XML Data files with a tag named PARTICIPATION_TYPE and i am trying to grep for that and getting unique values. However one of the xml data file data is not aligned properly like below.
File 1: (works fine when i do grep) grep "PARTICIPATION_TYPE" file1.xml | sort -u
Data:
....... (3 Replies)
Hi,
I have the below tag/s in my xml.
<foreign-server name="MOHTASHIM_SERVER">
What will be the easist way to extract MOHTASHIM_SERVER without the double quotes "" from the above tag?
Desired Output: (10 Replies)
how to get string from tags using sed and grep
i try to capture the tags :
<groupId>org.test.proj.assent</groupId>
<artifactId>mainapp</artifactId>
<version>mainapp.1.4</version>
<packaging>pom</packaging>
<name>main app 1</name>
and then from there i guess i will... (7 Replies)
Hi
I have below lists of files
filename-1.0.0.tar.gz
filename-1.0.1.345657676.snapshots.tar.gz
so when I do grep -o 'filename-*.tar.gz' | sort | tail -1
then it consider snapshots as a part of it's result.
How can I make sure, that it should only display the results from... (3 Replies)
Discussion started by: manas_ranjan
3 Replies
LEARN ABOUT DEBIAN
stag-grep
STAG-GREP(1p) User Contributed Perl Documentation STAG-GREP(1p)NAME
stag-grep - filters a stag file (xml, itext, sxpr) for nodes of interest
SYNOPSIS
stag-grep person -q name=fred file1.xml
stag-grep person 'sub {shift->get_name =~ /^A*/}' file1.xml
stag-grep -p My::Foo -w sxpr record 'sub{..}' file2
USAGE
stag-grep [-p|parser PARSER] [-w|writer WRITER] NODE -q tag=val FILE
stag-grep [-p|parser PARSER] [-w|writer WRITER] NODE SUB FILE
stag-grep [-p|parser PARSER] [-w|writer WRITER] NODE -f PERLFILE FILE
DESCRIPTION
parsers an input file using the specified parser (which may be a built in stag parser, such as xml) and filters the resulting stag tree
according to a user-supplied subroutine, writing out only the nodes/elements that pass the test.
the parser is event based, so it should be able to handle large files (although if the node you parse is large, it will take up more
memory)
ARGUMENTS
-p|parser FORMAT
FORMAT is one of xml, sxpr or itext, or the name of a perl module
xml assumed as default
-w|writer FORMAT
FORMAT is one of xml, sxpr or itext, or the name of a perl module
-c|count
prints the number of nodes that pass the test
-filterfile|f
a file containing a perl subroutine (in place of the SUB argument)
-q|query TAG1=VAL1 -q|query TAG2=VAL2 ... -q|query TAGN=VALN
filters based on the field TAG
other operators can be used too - eg <, <=, etc
multiple q arguments can be passed in
for more complex operations, pass in your own subroutine, see below
SUB a perl subroutine. this subroutine is evaluated evry time NODE is encountered - the stag object for NODE is passed into the subroutine.
if the subroutine passes, the node will be passed to the writer for display
NODE
the name of the node/element we are filtering on
FILE
the file to be parser. If no parser option is supplied, this is assumed to a be a stag compatible syntax (xml, sxpr or itext);
otherwise you should parse in a parser name or a parser module that throws stag events
SEE ALSO
Data::Stag
perl v5.10.0 2008-12-23 STAG-GREP(1p)