I have a file log with one information in many lines but i want the information log just per line.
How can i do to do this in shell langage.
Input file :
Code:
Info : [Log] etstst trerer
tetststsss
Warning : [Log] informatopnn
eysysysysys
rererererer
Error : [Log] this is an error log
with information in many phrases
what I need in output file:
Code:
Info : [Log] etstst trerer tetststsss
Warning : [Log] informatopnn eysysysysys
Error : [Log] this is an error log with information in many phrases
Thanks you in advance
Moderator's Comments:
Please use CODE tags when displaying sample input, sample output, and code segments.
Last edited by Don Cragun; 05-24-2016 at 04:44 PM..
Reason: Add CODE tags.
i="1"
while
do
k=`expr $i + 1`
sed -e 's/"$i"/"$k"/' < somefile1.txt >> somefile2.txt
i=`expr $i + 1`
done
ive been trying to :
1 from a file containing numbers in a row divided with correct number of 2 spaces to find the corresponding one
2 change the value
3 and append... (1 Reply)
i="1"
while
do
k=`expr $i + 1`
sed -e 's/"$i"/"$k"/' < somefile1.txt >> somefile2.txt
i=`expr $i + 1`
done
ive been trying to :
1 from a file containing numbers in a row divided with correct number of spaces to find the corresponding one
2 change the value
3 and append... (3 Replies)
Hi,
We have smb client running on two of the linux boxes and smb server on another linux system. During a backup operation which uses smb, read of a file was allowed while write to the same file was going on.Also simultaneous writes to the same file were allowed.Following are the settings in the... (1 Reply)
we have 4000 html pages that need an email address changed.
eg) company@yahoo.com to company@hotmail.com
we only want the file modified date to be changed when there has been a change to the file.
Should I be using grep?
I fairly new to UNIX and was told to using something like... (2 Replies)
Hi All,
I wanted to write a shell script which will change the expired passwd in oracle. Here is below what I am trying,
#!/bin/sh
set -x
ORACLE_HOME="/optware/oracle/9.2.0.2_64"
SQLPLUS="${ORACLE_HOME}/bin/sqlplus"
PASS="xyz"
PATH=$ORACLE_HOME/bin:$PATH... (0 Replies)
Hi, I am creating a ksh script to search for a string of text inside files within a directory tree. Some of these file are going to be read/execute only. I know to use chmod to change the permissions of the file, but I want to preserve the original permissions after writing to the file. How can I... (3 Replies)
I am now on Kernel 2.6.32-26
For me 16x CD write speed is okay.
I have old hardware which was able to write DVDs at 1x, back in previous linux version.
Now, I dont get speed of less than 4x.
Tested on k3b, xfburn, and brasero. But all start at bottom 4x write speed. k3b forced back to... (0 Replies)
Hi Friends,
I'm a great fan of this forum... it has helped me tone my skills in shell scripting. I have a challenge here, which I'm sure you guys would help me in achieving...
File A has a list of job ids and I need to compare this with the File B (*.log) and File C (extend *.log) and copy... (6 Replies)
I have file which contains a huge amount of data. I need to search the pattern Message id. When that pattern is matched I need to get abcdeff0-1g6g-91g3-1z2z-2mm605m90000 to another file.
Kindly provide your input.
File is like below
Jan 11 04:05:10 linux100 |NOTICE... (2 Replies)
Hi,
I need to compare 2 text files with around 60000 rows and 1 column. I need to compare these and write the mismatch data to 3rd file.
File1 - file2 = file3
wc -l file1.txt
58112
wc -l file2.txt
55260
head -5 file1.txt
101214200123
101214700300
101250030067
101214100500... (10 Replies)
Discussion started by: Divya Nochiyil
10 Replies
LEARN ABOUT DEBIAN
log::report::dispatcher::logdispatch
Log::Report::Dispatcher::LogDispatch(3pm) User Contributed Perl Documentation Log::Report::Dispatcher::LogDispatch(3pm)NAME
Log::Report::Dispatcher::LogDispatch - send messages to Log::Dispatch back-end
INHERITANCE
Log::Report::Dispatcher::LogDispatch
is a Log::Report::Dispatcher
SYNOPSIS
use Log::Dispatch::File;
dispatcher Log::Dispatch::File => 'logger', accept => 'NOTICE-'
, filename => 'logfile', to_level => [ 'ALERT-' => 'err' ];
# disable default dispatcher
dispatcher close => 'logger';
DESCRIPTION
This dispatchers produces output to and "Log::Dispatch" back-end. (which will NOT be automatically installed for you).
The REASON for a message often uses names which are quite similar to the log-levels used by Log::Dispatch. However: they have a different
approach. The REASON of Log::Report limits the responsibility of the programmer to indicate the cause of the message: whether it was able
to handle a certain situation. The Log::Dispatch levels are there for the user's of the program. However: the programmer does not known
anything about the application (in the general case). This is cause of much of the trickery in Perl programs.
The default translation table is list below. You can change the mapping using new(to_level). See example in SYNOPSIS.
METHODS
Constructors
$obj->close
See "Constructors" in Log::Report::Dispatcher
Log::Report::Dispatcher::LogDispatch->new(TYPE, NAME, OPTIONS)
The Log::Dispatch infrastructure has quite a large number of output TYPEs, each extending the Log::Dispatch::Output base-class. You do
not create these objects yourself: Log::Report is doing it for you.
The Log::Dispatch back-ends are very careful with validating their parameters, so you will need to restrict the options to what is
supported for the specific back-end. See their respective manual-pages. The errors produced by the back-ends quite horrible and
untranslated, sorry.
-Option--Defined in --Default
accept Log::Report::Dispatcher depend on mode
callbacks []
charset Log::Report::Dispatcher <undef>
format_reason Log::Report::Dispatcher 'LOWERCASE'
locale Log::Report::Dispatcher <system locale>
max_level undef
min_level debug
mode Log::Report::Dispatcher 'NORMAL'
to_level []
accept => REASONS
callbacks => CODE|ARRAY-of-CODE
See Log::Dispatch::Output.
charset => CHARSET
format_reason => 'UPPERCASE'|'LOWERCASE'|'UCFIRST'|'IGNORE'|CODE
locale => LOCALE
max_level => LEVEL
Like "min_level".
min_level => LEVEL
Restrict the messages which are passed through based on the LEVEL, so after the reason got translated into a Log::Dispatch compatible
LEVEL. The default will use Log::Report restrictions only.
mode => 'NORMAL'|'VERBOSE'|'ASSERT'|'DEBUG'|0..3
to_level => ARRAY-of-PAIRS
See reasonToLevel().
Accessors
$obj->backend
Returns the Log::Dispatch::Output object which is used for logging.
$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::LogDispatch->collectLocation
See "Logging" in Log::Report::Dispatcher
$obj->collectStack([MAXDEPTH])
Log::Report::Dispatcher::LogDispatch->collectStack([MAXDEPTH])
See "Logging" in Log::Report::Dispatcher
$obj->log(HASH-of-OPTIONS, REASON, MESSAGE)
See "Logging" in Log::Report::Dispatcher
$obj->reasonToLevel(REASON)
Returns a level which is understood by Log::Dispatch, based on a translation table. This can be changed with new(to_level).
$obj->stackTraceLine(OPTIONS)
Log::Report::Dispatcher::LogDispatch->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::LogDispatch(3pm)