Dear all,
I need to search multiple patterns and then I need to print their respective next lines. For an example, in the below table, I will look for 3 different patterns :
1) # ATC_Codes:
2) # Generic_Name:
3) # Drug_Target_1_Gene_Name:
#BEGIN_DRUGCARD DB00001
# AHFS_Codes:... (3 Replies)
Thanks for the help yesterday. I have a little modification today,
I am trying the following:
i have a log file of a webbap which logs in the following pattern:
2011-08-14 21:10:04,535 blablabla ERROR Exception1 blablabla
bla
bla
bla
bla
2011-08-14... (2 Replies)
Guys,
I am trying the following:
i have a log file of a webbap which logs in the following pattern:
2011-08-14 21:10:04,535 blablabla ERROR blablabla
bla
bla
bla
bla
2011-08-14 21:10:04,535 blablabla ERROR blablabla
bla
bla
bla
... (6 Replies)
Hi,
I am having an '.xml' file with 'n' number of lines and also having another file with '.txt' format contains values which i want to search.
Now I want to print the next line with the pattern which i am searching in '.xml' file. And the loop has to repeat for different patterns which... (5 Replies)
Hi,
I am having an '.xml' file with 'n' number of lines and also having another file with '.txt' format contains values which i want to search.
Now I want to print the next line with the pattern which i am searching in '.xml' file. And the loop has to repeat for different patterns which are... (4 Replies)
Hi,
I have a file, which contains the following log data.
I am trying to print fromt he file the following data:
I have tried using sed, but I am getting from the first pattern
Thanks for your help. (5 Replies)
Hello Friends,
I need to print lines in between two string when a keyword existed in those lines (keywords like exception, error, failed, not started etc).
for example,
input:
..
Begin Edr
ab12
ac13
ad14
bc23
exception occured
bd24
cd34
dd44
ee55
ff66
End Edr (2 Replies)
Hi,
I am trying to extract some patterns from a line. The input file is space delimited and i could not use column to get value after "IN" or "OUT" patterns as there could be multiple white spaces before the next digits that i need to print in the output file . I need to print 3 patterns in a... (3 Replies)
Hi,
I could only find examples to print line before/after a match, but I'd need to print line after two separate lines matching.
E.g.: From the below log entry, I would need to print out the 1234. This is from a huge log file, that has a lot of entries with "CLIENT" and "No" entries (+ other... (3 Replies)
My input looks like this.
# Lot Of CODE Before
AppType_somethinglese=$(cat << EOF
AppType_test1='test-tool/blatest-tool-ear'
AppType_test2='test/blabla-ear'
# Lot Of CODE After
I want to print text betwen 1) _ and = and 2)/ and ' from each line
and exclude lines with "EOF".
Output... (2 Replies)
Discussion started by: kchinnam
2 Replies
LEARN ABOUT DEBIAN
xml::quote
Quote(3pm) User Contributed Perl Documentation Quote(3pm)NAME
XML::Quote - XML quote/dequote functions
SYNOPSIS
use strict;
use XML::Quote qw(:all);
my $str=q{666 > 444 & "apple" < 'earth'};
print xml_quote($str),"
";
# 666 > 444 & "apple" < 'earth'
my $str2=q{666 > 444 & "apple" < 'earth'};
print xml_dequote($str2),"
";
# 666 > 444 & "apple" < 'earth'
my $str3=q{666 > 444 & "apple" < 'earth'};
print xml_quote_min($str3),"
";
# 666 > 444 & "apple" < 'earth'
DESCRIPTION
This module provides functions to quote/dequote strings in "xml"-way.
All functions are written in XS and are very fast; they correctly process utf8, tied, overloaded variables and all the rest of perl
"magic".
FUNCTIONS
$quoted = xml_quote($str);
This function replaces all occurences of symbols '&', '"', ''', '>', '<' to '&', '"', ''', '>', '<' respectively.
Returns quoted string or undef if $str is undef.
$dequoted = xml_dequote($str);
This function replaces all occurences of '&', '"', ''', '>', '<' to '&', '"', ''', '>', '<' respectively. All
other entities (for example ) will not be touched.
Returns dequoted string or undef if $str is undef.
$quoted = xml_quote_min($str);
This function replaces all occurences of symbols '&', '"', '<' to '&', '"', '<' respectively. Symbols ''' and '>' are not
replaced.
Returns quoted string or undef if $str is undef.
EXPORT
xml_quote(), xml_dequote() are exported as default.
PERFORMANCE
You can use t/benchmark.pl to test the perfomance. Here is the result on my P4 box.
Benchmark: timing 1000000 iterations of perl quote, xs quote...
perl quote: 108 wallclock secs (88.08 usr + 0.01 sys = 88.09 CPU) @ 11351.64/s (n=1000000)
xs quote: 20 wallclock secs (16.78 usr + 0.00 sys = 16.78 CPU) @ 59591.20/s (n=1000000)
Benchmark: timing 1000000 iterations of perl dequote, xs dequote...
perl dequote: 106 wallclock secs (85.22 usr + 0.09 sys = 85.31 CPU) @ 11721.54/s (n=1000000)
xs dequote: 19 wallclock secs (15.92 usr + 0.02 sys = 15.94 CPU) @ 62743.13/s (n=1000000)
AUTHOR
Sergey Skvortsov <skv@protey.ru>
SEE ALSO
http://www.w3.org/TR/REC-xml <http://www.w3.org/TR/REC-xml>, perlre
COPYRIGHT
Copyright 2003 Sergey Skvortsov <skv@protey.ru>. All rights reserved.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
perl v5.14.2 2008-06-26 Quote(3pm)