I have a perl function in my script that needs to replace an entire line in a file
sub changestate {
my $base = ();
my @base = ();
open(BASE, $file) || die("Could not open file!");
@base=<BASE>;
close (BASE);
foreach $base(@base)
{
if($base =~... (1 Reply)
Hey guys, I have a file that I've slowly been awking, seding, and greping for data entry. I am down to pull the addresses out to insert them into an excel file. Each address is a few lines, but i want to put a semicolon delimiter in between each address so I can export the text file into excel and... (6 Replies)
Friends,
I have .txt file with 3 millions of rows.
File1.txt
ABC1|A|ABCD1|XYZ1
ABC2|P|ABCD2|XYZ2
ABC3|A|ABCD3|XYZ3
ABC4|P|ABCD4|XYZ4
If second field has value P then print the entire line.
Thanks in advance for your help,
Prashant (4 Replies)
Hi everyone
I am new to Unix. I got stuck up by small issue.
I have text file something like this
abc 'xyz' '5'
lmn 'pqr' '7'
i want to replace the abc 'xyz' '5' to abc 'xyz' '6'
but i have a key as 'xyz' based on this key i want to do that.
I am not aware of how to use sed... (7 Replies)
As per my understanding below mentioned line of code finding a word 'boy' in $ACULOG...
num_errors=`grep -i -e fail -e illegal -e exception -e "<E" -e boy $ACULOG | wc -l`
if I'm not corerct, please correct me. How I can find entire line like "This is a boy" with something similar as above... (1 Reply)
Using the vanilla
ps -ef
I noticed that the CMD (or command) line gets cut off after 90 characters
UID PID PPID C STIME TTY TIME CMD
root 6020 3822 0 Jun 19 ? 0:01 ./webservd-wdog -r /export/opt/sows/61sp4 -d /export/opt/sows/61sp4/https-logse
Googling... (4 Replies)
Hello,
I do have several files in one folder each file contains measurement data.
for each file I would like to replace the character "," by "." ?
How can I do this and how can I do this for each file at once?
E.G. data_1.dat, data_x.dat (original version)
data_1out.dat, data_x_out.dat... (10 Replies)
Hi,
I need to replace an entire mailx line as follows using sed:
sed -e 's/<line1>/<newline>/g' <filename>
But I am getting comman garbled error since the new line has many special characters. I enclosed allspecial chars in \ but still no use.
Can any one help me?
Please use code... (2 Replies)
Hi Folks,
I have a report data like the one seen below.
FRUITS@NEW_ORANGE(1500 04/29)
FRUITS@NEW_ORANGE(1500 05/04)
FRUITS@NEW_ORANGE(1500 05/05)
FRUITS@NEW_ORANGE(1500 05/07)
FRUITS@NEW_ORANGE(1500 05/12)
I need to use each of this lines separately in another for loop like the one... (2 Replies)
Hello,
I have a file with multiple paragraphs/sections each starting with word "Handle" and if I grep for a pattern, I should get contents of entire section/para (not just line). Please advise, thanks!
#script.sh file.txt "System Information"
Handle 0x0001
DMI type 1, 27 bytes.
... (9 Replies)
Discussion started by: reddyr
9 Replies
LEARN ABOUT DEBIAN
log::agent::driver::default
Agent::Driver::Default(3pm) User Contributed Perl Documentation Agent::Driver::Default(3pm)NAME
Log::Agent::Driver::Default - default logging driver for Log::Agent
SYNOPSIS
# Implicit use
use Log::Agent;
logconfig(-prefix => "prefix"); # optional
# Explicit use
use Log::Agent;
require Log::Agent::Driver::Default;
my $driver = Log::Agent::Driver::Default->make("prefix");
logconfig(-driver => $driver);
DESCRIPTION
The default logging driver remaps the logxxx() operations to their default Perl counterpart. For instance, logerr() will issue a warn() and
logwarn() will call warn() with a clear "WARNING: " emphasis (to distinguish between the two calls).
The only routine of interest here is the creation routine:
make($prefix)
Create a Log::Agent::Driver::Default driver whose prefix string will be $prefix. When no prefix is configured, the first letter of each
logged string will be uppercased.
CHANNELS
The "error", "output" and "debug" channels all go to STDERR.
BUGS
If logdie() is used within an eval(), the string you will get in $@ will be prefixed. It's not really a bug, simply that wrapping a code
into eval() and parsing $@ is poor's man exception handling which shows its limit here: since the programmer using logdie() cannot foresee
which driver will be used, the returned string cannot be determined precisely. Morality: use die() if you mean it, and document the string
as an exception.
AUTHOR
Raphael Manfredi <Raphael_Manfredi@pobox.com>
SEE ALSO Log::Agent::Driver(3), Log::Agent(3).
perl v5.10.0 2009-07-23 Agent::Driver::Default(3pm)