Gawk --- produce the output in pattern space instead of END space
hi,
I'm trying to calculate IP addresses and their respective calls to our apache Server. The standard format of the input is
I'm using below given gawk code to do this ( that is accumulating all requests for all IPs in a given input file.
the problem:
input-file is actually around 47Gib in size and when I return the LINE array in END space of gawk, The process consumes all the available memory of the system and the system starts running out of memory for all other processes.
Question:
Can i return the LINE array in our pattern space rather than END space so that every IP matched is returned -- instead of adding it into array and then displaying the result.
------ Post updated at 02:16 PM ------
BTW, this code works fine for smaller file ( when I split the file into smaller chunks, which doesn't satisfy the requirement, as all the file must be scanned at once, so that I get all IPs list )
Hi....
I have a situation...I have a data file...that has space(an extra row with no data) at the end of file. I am trying to remove that spaces only if the file has a space at the end of file and if there is no space I don't want to do anything.
Can you please help me in this regards.
... (4 Replies)
Hi,
I have a txt file called a.txt which contain over 10,000 records and I would like to remove space before comma or after comma....like below:
The input (for example two record 00001,00002):
00001,client,card limited ,02292,N ,162:41 , 192, ... (6 Replies)
what can I use ??
In vi, I can use :set list <-- and see end of line $.. or use cat -A but I am wondering if there is command or program that allows me to see all the hidden characters( space, tab and etc)
Please help
thanks. (3 Replies)
cat file1|while read i
do
echo "$i"|wc
done
with this command the space in the end of the line not considered
how can solve that
for example:
read h
"hgyr "
echo "$h"|wc
4 (2 Replies)
Good afternoon! Im new at scripting and Im trying to write a script to
calculate total space, total used space and total free space in filesystem names matching a keyword (in this one we will use keyword virginia). Please dont be mean or harsh, like I said Im new and trying my best. Scripting... (4 Replies)
Hi
I guess this is very simple....
I want to add a space at the last line in a file.
The space has to be the last charachter on the last line, not at a new line.
Anyone ?? (7 Replies)
for eg:
i have i/p file as:
================
i
wnt
to
change end of line
=================
my require ouput is like:
i wnt to change end of line
==================== (7 Replies)
HI,
I need the help from the experts like I have created one file with text like:
Code:
a b c de f g hi j k l
So my question is that i have to write the script in which like in the first sentence it will take only one space after d and remove all the extra space in the end.I dont... (0 Replies)
I need to read in the string from input file and reform it by cut each segment and check the last segement lenght. If the last segment length is not as expected (see below segment file or table. It is predefined), then pad enough space.
Old string
FU22222222CA6666666666AKxvbFMddreeadBP999... (11 Replies)
Hi,
I have simply made a shell script to convert *.csv to *.xml file. Xml file is required for input to one tool. But i am getting space after last field. How can i remove it.
Shell script is as follows :-
if
then
echo ""
echo "Wrong syntax, Databse_update.sh... (6 Replies)
Discussion started by: stillrules
6 Replies
LEARN ABOUT DEBIAN
log::agent::tag::priority
Agent::Tag::Priority(3pm) User Contributed Perl Documentation Agent::Tag::Priority(3pm)NAME
Log::Agent::Tag::Priority - a log priority tag string
SYNOPSIS
Not intended to be used directly
Inherits from Log::Agent::Tag.
DESCRIPTION
This class represents a log priority tag string.
CREATION ROUTINE PARAMETERS
The following parameters are defined, in alphabetical order:
"-display" => string
Specifies the priority/level string to display, with minimal variable substitution. For instance:
-display => '[$priority/$level]'
The defined variables are documented in the DISPLAY VARIABLES section underneath.
"-level" => level
This parameter is internally added by "Log::Agent" when computing the priority tag, since only it knows the level of the current
messsage.
"-postfix" => flag
Whether tag should be placed after or before the log message. By default, it is prepended to the log message, i.e. this parameter is
false.
"-priority" => prio
This parameter is internally added by "Log::Agent" when computing the priority tag, since only it knows the priority of the current
messsage.
"-separator" => string
The separation string between the tag and the log message. A single space by default.
DISPLAY VARIABLES
The "-display" switch understands a few variables that can be substituted in the supplied string. Both $var and "${var}" forms are
supported. Unknown variables are left untouched.
$priority
The full priority name of the logged message, e.g. "warning" or "error".
$level
The associated priority level of the logged message, a number. For instance, the level associated to "warning" is 4. See
Log::Agent::Priorities for the default name -> level mapping.
AUTHOR
Raphael Manfredi <Raphael_Manfredi@pobox.com>
SEE ALSO Log::Agent::Tag(3), Log::Agent::Message(3), Log::Agent::Priorities(3).
perl v5.10.0 2002-03-09 Agent::Tag::Priority(3pm)