Hi All,
I have an input below. If the term in the 1st column is equal, print the last row which 1st column is equal.In the below example, it's " 0001 k= 27 " and " 0004 k= 6 " (depicted in bold). Those terms in 1st column which are not repetitive are to be printed as well. Can any body help me... (9 Replies)
Hi, I am totally new to shell scripting.
I have a String "c:\working\html\index.txt.12-12-2009.bkp" I want to check if the string has more than one "." character. If it does I would like to retrieve only "c:\working\html\index.txt" i.e, discard the second occurrence of "." and the rest of the... (7 Replies)
Hi all,
I have a lot of files with extension ".o" and I would like to extract the 10th line after (last) occurrence of a given string in each of the files.
I tried:
$ grep "string_to_look_for" *.o -A 10 | tail -1
but it gives the occurrence in the last file with extension .o
... (1 Reply)
Lets say I have file.txt:
(Product:Price:QuantityAvailable) (: as delimiter)
Chocolate:5:5
Banana:33:3
I am doing a edit/update function.
I want to change the Quantity Available, so I tried using the SED command to replace 5, but my Price which is also 5 is changed instead.
(for the Banana... (13 Replies)
Hi, i have file f1.txt with data like:
CHECK
a
b
CHECK
c
d
CHECK
e
f
JOB_START
....
I want to match the last occurrence of 'CHECK' until the end of the file.
I can use awk:
awk '/^CHECK/ { buf = "" } { buf = buf "\n" $0 } END { print buf }' f1.txt | tail +2Is there a cleaner way of... (2 Replies)
hey guys, i have been trying to work this thing out with sed with no luck :confused:
i m looking for a way to replace only the first occurrence after a match
for example :
Cat
Realized what you gotta do
Dog
Realized what you gotta do
Sheep
Realized what you gotta do
Wolf
Realized... (6 Replies)
echo 'String#1 and String#2' | egrep -o -m 1 'String#.{1}'
String#1
String#2
I'm trying to just match the first occurrence of 'String#' + 1 character. I thought the "-m 1" switch would do that for me. Instead I get both occurrences. Can somebody provide some insight?
Thanks! (5 Replies)
I need help with extract/print lines till stop pattern. This needs to happen after every 3rd occurrence of start pattern and continue till end of file. Consider below is an example of the log file. my start pattern will be every 3rd occurrence of ERROR_FILE_NOT_FOUND and stop pattern will be... (5 Replies)
Hi all,
I have an input file as below. I would like to count the occurrence of pattern matching 8th field for each line.
Input:
field_01 field_02 field_03 field_04 field_05 field_06 field_07 field_08
TA T TA T TA TA TA... (3 Replies)
AWK command to get file content until 3 occurrence of pattern match,
INPUT FILE:
JMS_BODY_FIELD:JMSText = <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<custOptIn xmlns="http://com/walm/ta/cu/ccs/xml2">
<person>Romi</person>
<appName>SAP</appName>
</custOptIn>
... (4 Replies)
Discussion started by: prince1987
4 Replies
LEARN ABOUT DEBIAN
template::timer
Timer(3pm) User Contributed Perl Documentation Timer(3pm)NAME
Template::Timer - Rudimentary profiling for Template Toolkit
VERSION
Version 1.00
SYNOPSIS
Template::Timer provides inline timings of the template processing througout your code. It's an overridden version of Template::Context
that wraps the "process()" and "include()" methods.
Using Template::Timer is simple.
use Template::Timer;
my %config = ( # Whatever your config is
INCLUDE_PATH => '/my/template/path',
COMPILE_EXT => '.ttc',
COMPILE_DIR => '/tmp/tt',
);
if ( $development_mode ) {
$config{ CONTEXT } = Template::Timer->new( %config );
}
my $template = Template->new( \%config );
Now when you process templates, HTML comments will get embedded in your output, which you can easily grep for. The nesting level is also
shown.
<!-- TIMER START: L1 process mainmenu/mainmenu.ttml -->
<!-- TIMER START: L2 include mainmenu/cssindex.tt -->
<!-- TIMER START: L3 process mainmenu/cssindex.tt -->
<!-- TIMER END: L3 process mainmenu/cssindex.tt (17.279 ms) -->
<!-- TIMER END: L2 include mainmenu/cssindex.tt (17.401 ms) -->
....
<!-- TIMER END: L3 process mainmenu/footer.tt (3.016 ms) -->
<!-- TIMER END: L2 include mainmenu/footer.tt (3.104 ms) -->
<!-- TIMER END: L1 process mainmenu/mainmenu.ttml (400.409 ms) -->
Note that since INCLUDE is a wrapper around PROCESS, calls to INCLUDEs will be doubled up, and slightly longer than the PROCESS call.
AUTHOR
Andy Lester, "<andy at petdance.com>"
BUGS
Please report any bugs or feature requests to "bug-template-timer at rt.cpan.org", or through the web interface at <http://rt.cpan.org>. I
will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
ACKNOWLEDGEMENTS
Thanks to Randal Schwartz, Bill Moseley, and to Gavin Estey for the original code.
COPYRIGHT & LICENSE
This library is free software; you can redistribute it and/or modify it under the terms of either the GNU Public License v3, or the
Artistic License 2.0.
* http://www.gnu.org/copyleft/gpl.html
* http://www.opensource.org/licenses/artistic-license-2.0.php
perl v5.12.4 2009-03-07 Timer(3pm)