Your entire cat/tail/grep/awk... could be simplified and the avg calculation could incorporated into the pipeline, but as a stand-alone avg calculation given your sample file is:
Are you able to explain this code to me not sure I understand it fully?
Well I have a 3000 lines result log file that contains all the machine data when it does the testing... It has 3 different section that i am intrsted in
1) starting with "20071126 11:11:11 Machine Header 1"
1000 lines...
"End machine header 1"
2) starting with "20071126 12:12:12 Machine... (5 Replies)
Just wondering if someone could assist me with shell script I'm trying to write. I need to read the final column of a text file (shown below) and workout what the average number is. The text file will have a variable number of lines, I just want the script to pull out the values in the final field... (14 Replies)
Hi
Below command is returning the list of files which having this string "MTL_SYSTEM_ITEMS".
find . -name "*"|xargs grep -il MTL_SYSTEM_ITEMS
Ex: Above command is returing 2 files (Out of 10 files 2 files having this string). ./file1.txt and ./file2.txt
Here I want to append... (3 Replies)
Hi,
first, I have searched in the forum for this, but I could not find the right answer. (There were some similar threads, but I was not sure how to adapt the ideas.)
Anyway, I have a quite natural problem: Given are several text files. All files contain the same number of lines and the same... (3 Replies)
Dear Gurus,
I have tab-delimited text files with matrix containing values. The first column is a identifier and other columns have the corresponding values. I would like to calculate the average value (total number/number of entries) for all entries from 2nd column to the last column in row... (3 Replies)
Dear All
I have a script file like the following:
.....
.....
Variable_1 = 888
Variable_2 = 999
.....
MyExternalProgram Myfile
.....
The line MyExternalProgram Myfile will generate some number, Say 777
Now I hope I can output the result of above codes to a text file,... (2 Replies)
Currently I have a perl code to combine two different files.
#! /usr/bin/perl -w
use strict;
open FP1,"A.txt";
open FP2,"B.txt";
my ($l1,$l2);
while(1)
{
$l1=<FP1>; chomp $l1;
$l2=<FP2>; chomp $l2;
last unless(defined $l1 or defined $l2);
print "$l1 $l2\n";
}
close FP2;... (4 Replies)
Hi,
I have a problem where i have to hit multiple URL that are stored in a text file (input.txt) and save their output in different text file (output.txt) somewhat like :
cat input.txt
http://192.168.21.20:8080/PPUPS/international?NUmber=917875446856... (3 Replies)
I am trying using awk to open an input file and check a column 2/field $2 and if there is a warning then that is displayed (variantchecker): G not found at position 459, found A instead. The attached Sample1.txt is that file. If in that column/field there is a black space, then the text after... (6 Replies)
Discussion started by: cmccabe
6 Replies
LEARN ABOUT SUSE
mysqldumpslow
MYSQLDUMPSLOW(1) MySQL Database System MYSQLDUMPSLOW(1)NAME
mysqldumpslow - Summarize slow query log files
SYNOPSIS
mysqldumpslow [options] [log_file ...]
DESCRIPTION
The MySQL slow query log contains information about queries that take a long time to execute (see Section 5.2.5, "The Slow Query Log").
mysqldumpslow parses MySQL slow query log files and prints a summary of their contents.
Normally, mysqldumpslow groups queries that are similar except for the particular values of number and string data values. It "abstracts"
these values to N and 'S' when displaying summary output. The -a and -n options can be used to modify value abstracting behavior.
Invoke mysqldumpslow like this:
shell> mysqldumpslow [options] [log_file ...]
mysqldumpslow supports the following options.
o --help
Display a help message and exit.
o -a
Do not abstract all numbers to N and strings to 'S'.
o --debug, -d
Run in debug mode.
o -g pattern
Consider only queries that match the (grep-style) pattern.
o -h host_name
Host name of MySQL server for *-slow.log file name. The value can contain a wildcare. The default is * (match all).
o -i name
Name of server instance (if using mysql.server startup script).
o -l
Do not subtract lock time from total time.
o -n N
Abstract numbers with at least N digits within names.
o -r
Reverse the sort order.
o -s sort_type
How to sort the output. The value of sort_type should be chosen from the following list:
o t, at: Sort by query time or average query time
o l, al: Sort by lock time or average lock time
o s, as: Sort by rows sent or average rows sent
o c: Sort by count
o -t N
Display only the first N queries in the output.
o --verbose, -v
Verbose mode. Print more information about what the program does.
Example of usage:
shell> mysqldumpslow
Reading mysql slow query log from /usr/local/mysql/data/mysqld51-apple-slow.log
Count: 1 Time=4.32s (4s) Lock=0.00s (0s) Rows=0.0 (0), root[root]@localhost
insert into t2 select * from t1
Count: 3 Time=2.53s (7s) Lock=0.00s (0s) Rows=0.0 (0), root[root]@localhost
insert into t2 select * from t1 limit N
Count: 3 Time=2.13s (6s) Lock=0.00s (0s) Rows=0.0 (0), root[root]@localhost
insert into t1 select * from t1
COPYRIGHT
Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc.
This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as
published by the Free Software Foundation; version 2 of the License.
This documentation is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with the program; if not, write to the Free Software Foundation,
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or see http://www.gnu.org/licenses/.
SEE ALSO
For more information, please refer to the MySQL Reference Manual, which may already be installed locally and which is also available online
at http://dev.mysql.com/doc/.
AUTHOR
Sun Microsystems, Inc. (http://www.mysql.com/).
MySQL 5.1 04/06/2010 MYSQLDUMPSLOW(1)