Hi
I am writing a script which should read a file and search for certain strings 'approved' or 'removed' and retain only those lines that contain the above strings.
Ex: file name 'test'
test:
approved package
waiting for approval package
disapproved package
removed package
approved... (14 Replies)
Hey all, a relative bash/script newbie trying solve a problem.
I've got a text file with lots of lines that I've been able to clean up and format with awk/sed/cut, but now I'd like to remove the lines with duplicate usernames based on time stamp. Here's what the data looks like
2007-11-03... (3 Replies)
Hello guys,
should be a very easy questn for you:
I need to delete strings in file1 based on the list of strings in file2.
like file2:
word1_word2_
word3_word5_
word3_word4_
word6_word7_
file1:
word1_word2_otherwords..,word3_word5_others... (7 Replies)
Platform : RHEL 5.8
I have text file called myapplication.log . In this file, I have around 800 lines which start with the followng three strings
PWRBRKER-3493
PWRBRKER-7834
SCHEDULER-ERROR
How can I delete these lines in one go ? (13 Replies)
if I have the following lines in a file app.log
some lines here
<AAAA>
abc
<id>123456789</id>
ddd
</AAAA>some lines here too
<BBBB>
abc
<id>123456789</id>
ddd
</BBBB>some lines here too
<AAAA>
xyz
<id>987654321</id>
ssss
</AAAA>some lines here again...
How do I get the... (5 Replies)
Hi,
i need help to remove duplicates in my file. The problem is i need to delete one duplicate for each line only. the input file as follows and it is not tab delimited:-
The output need to remove 2nd word (in red) that duplicate with 1st word (in blue). Other duplicates should remained... (12 Replies)
I want to replace strings in test2 according to test1 table. In doing so, I`m losing records that I dont need to replace, please suggest modifications.
what i have
$ cat > test1
a b
c d
$ cat > test2
a
a
a
d
d
what i tried
$ awk ' BEGIN {FS=OFS=" "} FNR==NR{a=$2;next}... (2 Replies)
Within my text file i have several thousand lines of text with some lines containing duplicate strings/words. I would like to entirely remove those lines which contain the duplicate strings.
Eg;
One and a Two
Unix.com is the Best
This as a Line Line
Example duplicate sentence with the word... (22 Replies)
Hello Everyone ,
Iam a newbie to shell programming and iam reaching out if anyone can help in this :-
I have two files
1) Insert.txt
2) partition_list.txt
insert.txt looks like this :-
insert into emp1 partition (partition_name)
(a1,
b2,
c4,
s6,
d8)
select
a1,
b2,
c4, (2 Replies)
I cannot seem to get what should be a simple awk one-liner to work correctly and cannot figure out why. I would like to use patterns from a specific field in one file as regex to search for matching strings in the entire line ($0) of another file.
I would like to output the lines of File2 which... (1 Reply)
Discussion started by: jvoot
1 Replies
LEARN ABOUT DEBIAN
mkdoc::xml::tagger
MKDoc::XML::Tagger(3pm) User Contributed Perl Documentation MKDoc::XML::Tagger(3pm)NAME
MKDoc::XML::Tagger - Adds XML markup to XML / XHTML content.
SYNOPSIS
use MKDoc::XML::Tagger;
print MKDoc::XML::Tagger->process_data (
"<p>Hello, World!</p>",
{ _expr => 'World', _tag => 'strong', class => 'superFort' }
);
Should print:
<p>Hello, <strong class="superFort">World</strong>!</p>
SUMMARY
MKDoc::XML::Tagger is a class which lets you specify a set of tag and attributes associated with expressions which you want to mark up.
This module will then stuff any XML you send out with the extra expressions.
For example, let's say that you have a document which has the term 'Microsoft Windows' several times in it. You could wish to surround any
instance of the term with a <trademark> tag. MKDoc::XML::Tagger lets you do exactly that.
In MKDoc, this is used so that editors can enter hyperlinks separately from the content. It allows them to enter content without having to
worry about the annoying <a href="..."> syntax. It also has the added benefit from preventing bad information architecture such as the
'click here' syndrome.
We also have plans to use it for automatically linking glossary words, abbreviation tags, etc.
MKDoc::XML::Tagger is also probably a very good tool if you are building some kind of Wiki system in which you want expressions to be
automagically hyperlinked.
DISCLAIMER
This module does low level XML manipulation. It will somehow parse even broken XML and try to do something with it. Do not use it unless
you know what you're doing.
API
The API is very simple.
my $result = MKDoc::XML::Tagger->process_data ($xml, @expressions);
Tags $xml with the @expressions list.
Each element of @expressions is a hash reference looking like this:
{
_expr => 'Some Expression',
_tag => 'foo',
attribute1 => 'bar'
attribute2 => 'baz'
}
Which will try to turn anything which looks like:
Some Expression
sOmE ExPrEssIoN
(etcetera)
Into:
<foo attr1="bar" attr2="baz">Some Expression</foo>
<foo attr1="bar" attr2="baz">sOmE ExPrEssIoN</foo>
<foo attr1="bar" attr2="baz">(etcetera)</foo>
You can have multiple expressions, in which case longest expressions are processed first.
my $result = MKDoc::XML::Tagger->process_file ('some/file.xml', @expressions);
Same as process_data(), except it takes its data from 'some/file.xml'.
NOTES
MKDoc::XML::Tagger does not really parse the XML file you're giving to it nor does it care if the XML is well-formed or not. It uses
MKDoc::XML::Tokenizer to turn the XML / XHTML file into a series of MKDoc::XML::Token objects and strictly operates on a list of tokens.
For this same reason MKDoc::XML::Tagger does not support namespaces.
AUTHOR
Copyright 2003 - MKDoc Holdings Ltd.
Author: Jean-Michel Hiver
This module is free software and is distributed under the same license as Perl itself. Use it at your own risk.
SEE ALSO
MKDoc::XML::Tokenizer MKDoc::XML::Token
perl v5.10.1 2005-03-10 MKDoc::XML::Tagger(3pm)