I have a file which has some lines starting with a particular word. I would like to delete 5 lines before each such line containing that particular word.
eg:
line1
line2
line3
line4
line5
line6
"particular word"...
I would like to delete line2-line6 and all such occurences in that... (4 Replies)
Hi,
I'am working under unix solaris
I have a text file with set of lines, each set of lines (BLOCK) have
three fixed lines :
Between SECND line and THEND we have N lines, N differ from a block to another
sample :
i have to make a script wich delete each 3 fixed lines if N=0... (3 Replies)
I want to delete all lines from a file (orig_file) that contain the regex values (bad_inv_list)
I tried a for each loop with sed but it isn't working
for file in `cat bad_inv_list`;
do
sed '/$file/d' orig_file > pared_down_file.1
mv pared_down_file.1 orig_file
done
I've added... (2 Replies)
I have a big file having 100 K lines.
I have to read each line and see at 356 character position whethere there is a word "W" in it. If it is their then don't delete the line otherwise delete it.
There are two lines as one Header and one trailer which should remain same.
Can somebody... (5 Replies)
Hi,
I have a file with 20 columns of data and hundreds of lines of the same format.
Here is an example line. The data repeats underneath with the same format.
15 1 4 GLY - 1 65 LYSH 23 N - 24 H - 634 O 0.188 157.552 487 48.70I have been sorting this data by hand but I was wondering if I... (3 Replies)
I'm trying to create a script.
There are 2 files - fileA.log & fileB.log
fileA.log has the below data :
aaaa
cccc
eeee
fileB.log has the below data :
cjahdskjah aaaa xyz
jhaskjdhas bbbb abc
ajdhjkh cccc abc
cjahdskjah ... (7 Replies)
Hi,
I'm trying to search for some number and from that line, i need to delete the 5th line exactly.
Eg:
Consider below as text file data:
10000
a
b
c
d
e
.
.
.
10000
w
q
t (8 Replies)
Discussion started by: Gautham
8 Replies
LEARN ABOUT DEBIAN
log::report::dispatcher::callback
Log::Report::Dispatcher::Callback(3pm) User Contributed Perl Documentation Log::Report::Dispatcher::Callback(3pm)NAME
Log::Report::Dispatcher::Callback - call a code-ref for each log-line
INHERITANCE
Log::Report::Dispatcher::Callback
is a Log::Report::Dispatcher
SYNOPSIS
sub cb($$$)
{ my ($options, $reason, $message) = @_;
...
}
dispatcher Log::Report::Dispatcher::Callback => 'cb'
, callback => &cb;
dispatcher CALLBACK => 'cb' # same
, callback => &cb;
DESCRIPTION
This basic file logger accepts a callback, which is called for each message which is to be logged. When you need complex things, you may
best make your own extension to Log::Report::Dispatcher, but for simple things this will do.
METHODS
Constructors
$obj->close
See "Constructors" in Log::Report::Dispatcher
Log::Report::Dispatcher::Callback->new(TYPE, NAME, OPTIONS)
-Option--Defined in --Default
accept Log::Report::Dispatcher depend on mode
callback <required>
charset Log::Report::Dispatcher <undef>
format_reason Log::Report::Dispatcher 'LOWERCASE'
locale Log::Report::Dispatcher <system locale>
mode Log::Report::Dispatcher 'NORMAL'
accept => REASONS
callback => CODE
Your "callback" is called with four parameters: this dispatcher object, the options, a reason and a message. The "options" are the
first parameter of Log::Report::report() (read over there). The "reason" is a capitized string like "ERROR". Finally, the "message"
is a Log::Report::Message.
charset => CHARSET
format_reason => 'UPPERCASE'|'LOWERCASE'|'UCFIRST'|'IGNORE'|CODE
locale => LOCALE
mode => 'NORMAL'|'VERBOSE'|'ASSERT'|'DEBUG'|0..3
Accessors
$obj->callback
Returns the code reference which will handle each logged message.
$obj->isDisabled
See "Accessors" in Log::Report::Dispatcher
$obj->mode
See "Accessors" in Log::Report::Dispatcher
$obj->name
See "Accessors" in Log::Report::Dispatcher
$obj->needs
See "Accessors" in Log::Report::Dispatcher
$obj->type
See "Accessors" in Log::Report::Dispatcher
Logging
$obj->collectLocation
Log::Report::Dispatcher::Callback->collectLocation
See "Logging" in Log::Report::Dispatcher
$obj->collectStack([MAXDEPTH])
Log::Report::Dispatcher::Callback->collectStack([MAXDEPTH])
See "Logging" in Log::Report::Dispatcher
$obj->log(HASH-of-OPTIONS, REASON, MESSAGE)
See "Logging" in Log::Report::Dispatcher
$obj->stackTraceLine(OPTIONS)
Log::Report::Dispatcher::Callback->stackTraceLine(OPTIONS)
See "Logging" in Log::Report::Dispatcher
$obj->translate(HASH-of-OPTIONS, REASON, MESSAGE)
See "Logging" in Log::Report::Dispatcher
SEE ALSO
This module is part of Log-Report distribution version 0.94, built on August 23, 2011. Website: http://perl.overmeer.net/log-report/
LICENSE
Copyrights 2007-2011 by Mark Overmeer. For other contributors see ChangeLog.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See
http://www.perl.com/perl/misc/Artistic.html
perl v5.14.2 2011-08-23 Log::Report::Dispatcher::Callback(3pm)