02-17-2012
how to get tags content by grep
1) Is it possible to get tags content by grep -E ? For example title. Source text "<title>My page<title>"; to print "My page".
2) which bash utility to use when I want to use regex in this format?
(?<=title>).*(?=</title)
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
egrep Date: *.html > out.htm
I would like to grep the match as sorted by time stamp of the html files. how do I do that? (1 Reply)
Discussion started by: zer0
1 Replies
2. UNIX for Dummies Questions & Answers
I try to collect first those content like <w c5=".*" hw=".*" pos=".*?">.*</w> in that A00.xml.
I use the following pattern :
egrep "<w c5=".*" hw=".*" pos=".*?">.*</w>" A00.xml
The result is:
<s n="396"><w c5="PNP" hw="we" pos="PRON">We </w><w c5="VVB" hw="make" pos="VERB">make </w><w... (3 Replies)
Discussion started by: Johnivy
3 Replies
3. Shell Programming and Scripting
Hello,
I trying to extract text that is surrounded by xml-tags. I tried this
cat tst.xml | egrep "<SERVER>.*</SERVER>" |sed -e "s/<SERVER>\(.*\)<\/SERVER>/\1/"|tr "|" " "
which works perfect, if the start-tag and the end-tag are in the same line, e.g.:
<tag1>Hello Linux-Users</tag1>
... (5 Replies)
Discussion started by: Sebi0815
5 Replies
4. Shell Programming and Scripting
Hi all,
I have a file which will be updated every half an hour and time stamp will be printed in the beginning of the updation. i just want to grep the content between every hoalf an hour.
Pls help me on this issue. how to grep contents between tim stamp?
Ex of file:
29/09/2010... (20 Replies)
Discussion started by: steve2216
20 Replies
5. Shell Programming and Scripting
I need to know if is possible to use grep to check content of a local variable, for eg. i use read index and i want to check if the index i read is in correct form, how do i do that i tried with grep but i get errors all the time dont know how to make it work.. thanks! (3 Replies)
Discussion started by: Goroner
3 Replies
6. Shell Programming and Scripting
Hello,
i have this issue:
text="-8x7YTVNk2KiuY-PWG5zzzjB-zzw"
string=-8x7YTVNk2KiuY-PWG5zzzjB-zzw
echo $text | grep -v \'$string\'
-8x7YTVNk2KiuY-PWG5zzzjB-zzw
echo \'$string\'
'-8x7YTVNk2KiuY-PWG5zzzjB-zzw'
..and ofcourse if I do like this :
echo $text | grep -v $string
grep: invalid... (5 Replies)
Discussion started by: black_fender
5 Replies
7. Shell Programming and Scripting
I want to grep the content performed by an User from a file. Suppose that i have a following file
HYD-HMS-2$ ls -lrt
-rw-r--r-- 1 sdfrun sdf 31726356 Aug 1 13:04 journal.03.01082012.19.csv
I could able to grep the content performed by a user by "sed" command as follows
HYD-HMS-2$... (0 Replies)
Discussion started by: duppalav
0 Replies
8. Shell Programming and Scripting
Am using the following grep to match a particular patter in grep.
grep xyz abc.txt
now while i run this command, if the pattern matched, am getting the line containing xyz
Output: xyz is doing some work
Now if i want the file name also along with my output, what should i do
Expected... (2 Replies)
Discussion started by: rituparna_gupta
2 Replies
9. UNIX for Dummies Questions & Answers
I have an xml file with header as below.
<Provider xmlns="http://www.xyzx.gov/xyz" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.xyzx.gov/xyz xyz.xsd" SCHEMA_VERSION="2.5" PROVIDER="5">
I want to get the schema version here that is 2.5 and put in a... (7 Replies)
Discussion started by: Ariean
7 Replies
10. Shell Programming and Scripting
cat file1
*FileHeader* Partition 0
Total Data Bytes 1416
Avg Bytes/Record 1416
Others 1
PRDX22.AUDIT_DATA_INFO Partition 4
Total Data Bytes 4615
Avg... (8 Replies)
Discussion started by: Veera_V
8 Replies
LEARN ABOUT DEBIAN
ns_connreturndata
Ns_ConnReturnData(3aolserver) AOLserver Library Procedures Ns_ConnReturnData(3aolserver)
__________________________________________________________________________________________________________________________________________________
NAME
Ns_ConnReturnAdminNotice, Ns_ConnReturnData, Ns_ConnReturnHtml, Ns_ConnReturnNotice - Routines to generate simple single-buffer responses
SYNOPSIS
#include "ns.h"
int
Ns_ConnReturnAdminNotice(conn, status, title, msg)
int
Ns_ConnReturnData(conn, status, data, len, type)
int
Ns_ConnReturnCharData(conn, status, data, len, type)
int
Ns_ConnReturnHtml(conn, status, msg, len)
int
Ns_ConnReturnNotice(conn, status, title, msg)
ARGUMENTS
Ns_Conn conn (in) Pointer to open connection.
int status (in) HTTP response status code.
char *type (in) Output content type.
char *title (in) Pointer to HTML page title string.
int len (in) Length of content buffer.
char *data (in) Pointer to content buffer.
char *msg (in) Pointer to HTML message buffer.
_________________________________________________________________
DESCRIPTION
These routines are used to generate complete responses, including headers, status codes, content types, and the requested data. They all
return a status code which is NS_OK if the response was sent or NS_ERROR if an underlying call to sent the content failed.
int Ns_ConnReturnAdminNotice(conn, status, title, msg)
This routine is equivalent to Ns_ConnReturnNotice. In prior versions, it would format a slightly different response which was later
considered inconsequential.
int Ns_ConnReturnData(conn, status, data, len, type)
Generates a reponse with the given HTTP status including a content-type header with the given type. Content pointed to by the data
argument of length len is then sent without any modification via an underlying call to Ns_ConnFlushDirect.
int Ns_ConnReturnCharData(conn, status, data, len, type)
Generates a response as with Ns_ConnReturnData except that the given content pointed to by data is assumed to be a text stream which
is output encoded using the appropriate Tcl_Encoding based on the given type mimetype and possibly gzip compressed via an underlying
call to Ns_ConnFlush.
int Ns_ConnReturnHtml(conn, status, msg, len)
This is equivalent to Ns_ConnReturnCharData(conn, status, msg, len, "text/html").
int Ns_ConnReturnNotice(conn, status, title, msg)
Constructs a basic HTML response and sends it via Ns_ConnReturnHtml. The title string is placed both in the <head> portion as well
as an <h2> tag in the <body> portion of the document. If the title is NULL, it defaults to the string "Server Message". The msg
string, if not NULL, follows the body and is copied unaltered. This routine is useful for generating very basic responses. For
example, it is used by the various builtin reponse routines such as Ns_ConnReturnUnauthorized.
SEE ALSO
Ns_ConnFlush(3), Ns_ConnReturnFile, Ns_ConnReturnOpenFd, Ns_ConnReturnUnathorized.
KEYWORDS
connnection, encoding, response
AOLserver 4.0 Ns_ConnReturnData(3aolserver)