Hi,
I want to print only lines in between two strings and not the strings using awk.
Eg:
OUTPUT
top 2
bottom 1
left 0
right 0
page 66
END
I want to print into a new file only
top 2
bottom 1
left 0... (4 Replies)
Hi everyone!
I'm not new to Unix, but I've never used awk before.
I tried to look up this information on several sites and forums,
I also looked in the documentation but I haven't found a solution yet.
I would like to print the previous 3 lines before and the following 4 lines after the... (6 Replies)
I have a huge file and want to separate it into several subsets.
The file looks like:
C1 C2 C3 C4 ... (variable names)
1 ....
2 ....
3 ....
:
22 ....
23 ....
I want to separate the huge file using the column 1, which has numbers from 1 to 23 (but there are different amount of... (8 Replies)
Hi All,
Please find my piece of code below. I am trying to grep the word SUCCESS from $LOGFILE and storing in the grepvar variable. And i am placing that variable in a file. Now if i open the file, i can see the four lines but not in seperate four line s but in a paragraph. If am mailing that log... (8 Replies)
Hi guys,
say I have a few files in a directory (58 text files or somthing)
each one contains mulitple strings that I wish to replace with other strings
so in these 58 files I'm looking for say the following strings:
JAM (replace with BUTTER)
BREAD (replace with CRACKER)
SCOOP (replace... (19 Replies)
I want to search files (basically .cc files) in /xx folder and subfolders.
Those files (*.cc files) must contain #include "header.h" AND x() function.
I am writing it another way to make it clear,
I wanna list of *.cc files that have 'header.h' & 'x()'. They must have two strings, header.h... (2 Replies)
Hi,
I am trying to get lines between the last occurrences of two patterns. I have files that have several occurrences of “Standard” and “Visual”. I will like to get the lines between “Standard” and “Visual” but I only want to retain only the last one e.g.
Standard
Some words
Some words
Some... (4 Replies)
Hi,
I need a help to search a pattern and print the multiple lines between them.
Input file:
Tue May 29 12:30:33 EDT 2012:threadWebContainer : 357:com.travimp.hotelierlinks.abba.service.RequestHandler.requestService(String, ITICSDataSet): hotelCancelReservation request: ... (4 Replies)
Hi,
I am running the following:
PASS="username/password"
sqlplus -s << EOF | grep -v "^$"
$PASS
set feedback off
set heading off
set termout off
select name from v\$database ;
exit
EOF
Which gives
ERROR:
ORA-28002: the password will expire within 5 days
PSMP1 (1 Reply)
Hi, I have multiple files on a directory with the following content:
blahblah
blahblah
hostname server1
blahblah
blahblah
---BEGIN---
aaa
bbb
ccc
ddd
---END---
blahblah
blahblah
blahblah
I would like to filter all the files with awk or sed or something else so I can get below... (6 Replies)
Discussion started by: bayupw
6 Replies
LEARN ABOUT DEBIAN
template::plugin::xml::xpath
Template::Plugin::XML::XPath(3pm) User Contributed Perl Documentation Template::Plugin::XML::XPath(3pm)NAME
Template::Plugin::XML::XPath - Plugin interface to XML::XPath
SYNOPSIS
# load plugin and specify XML file to parse
[% USE xpath = XML.XPath(xmlfile) %]
[% USE xpath = XML.XPath(file => xmlfile) %]
[% USE xpath = XML.XPath(filename => xmlfile) %]
# load plugin and specify XML text to parse
[% USE xpath = XML.XPath(xmltext) %]
[% USE xpath = XML.XPath(xml => xmltext) %]
[% USE xpath = XML.XPath(text => xmltext) %]
# then call any XPath methods (see XML::XPath docs)
[% FOREACH page = xpath.findnodes('/html/body/page') %]
[% page.getAttribute('title') %]
[% END %]
# define VIEW to present node(s)
[% VIEW repview notfound='xmlstring' %]
# handler block for a <report>...</report> element
[% BLOCK report %]
[% item.content(view) %]
[% END %]
# handler block for a <section title="...">...</section> element
[% BLOCK section %]
<h1>[% item.getAttribute('title') | html %]</h1>
[% item.content(view) %]
[% END %]
# default template block passes tags through and renders
# out the children recursivly
[% BLOCK xmlstring;
item.starttag; item.content(view); item.endtag;
END %]
# block to generate simple text
[% BLOCK text; item | html; END %]
[% END %]
# now present node (and children) via view
[% repview.print(page) %]
# or print node content via view
[% page.content(repview) %]
DESCRIPTION
This is a Template Toolkit plugin interfacing to the XML::XPath module.
All methods implemented by the XML::XPath modules are available. In addition, the XML::XPath::Node::Element module implements
present($view) and content($view) methods method for seamless integration with Template Toolkit VIEWs. The XML::XPath::Node::Text module
is also adorned with a present($view) method which presents itself via the view using the 'text' template.
To aid the reconstruction of XML, methods starttag and endtag are added to XML::XPath::Node::Element which return the start and end tag for
that element. This means that you can easily do:
[% item.starttag %][% item.content(view) %][% item.endtag %]
To render out the start tag, followed by the content rendered in the view "view", followed by the end tag.
AUTHORS
This plugin module was written by Andy Wardley.
The XML::XPath module is by Matt Sergeant.
COPYRIGHT
Copyright (C) 1996-2006 Andy Wardley. All Rights Reserved.
This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
SEE ALSO
Template::Plugin, XML::XPath, XML::Parser
perl v5.8.8 2008-03-01 Template::Plugin::XML::XPath(3pm)