Hi,
I am facing a small problem while I am doing the sort.
Problem Definition:
I have a file which has the following data.
>cat test.dat
zxzxc
asdasd
qwaxcZa
qwaxcA
When I do a sort on this file.
the result set is
asdasd
qwaxcA (4 Replies)
Suppose I want to find the number of uniq lines in a file. I use the following command:
sort file1 | uniq -c | wc -l
But if for some reason sort fails, the above command returns 0 as the answer.
Why would sort fail ? sort makes use of directories /tmp or /var/tmp to store temporary files.... (7 Replies)
I have a text file comprising of 3 columns
1. First column - numeric count/frequency of error codes
2. Second column - alphanumeric hyphenated error code
3. Third column - Error code description (alphanumeric)
184 ABCD-954 Errorcodedescription1
35645 DFMS-323 Errorcodedescription2
43534 ... (2 Replies)
Hi,
I would like to know given that I have 3 columns.
Let say I have first 3 columns to do operation and these operation output is printed out each line by line using AWK and associative array.Currently in the output file, I do a sort by -r for the operation output.
The problem comes to... (1 Reply)
Hi All,
After Sorting directories and files i have got following output as below, now i only want the strings common in them, so the actual output should be as below in the bottom. How do i do that?
Thanks
-adsi
File to be modified:-
Common Components for ----> AA... (4 Replies)
Hello All,
Today i have been asking lots of question, hope to become good in scripting soon with all the wonderful advices i get. The question is i want to sort data a get uniq string from it. The code i am using to generate the output is:-
check_sun() {
for i in $SUN_PLATFORM
do
$ECHO... (0 Replies)
Hi to all.
I'm trying to sort this with the Unix command sort.
user1:12345678:3.5:2.5:8:1:2:3
user2:12345679:4.5:3.5:8:1:3:2
user3:12345687:5.5:2.5:6:1:3:2
user4:12345670:5.5:2.5:5:3:2:1
user5:12345671:2.5:5.5:7:2:3:1
I need to get this:
user3:12345687:5.5:2.5:6:1:3:2... (7 Replies)
I have a file with three fields of data for example say we have
1420 $12.56 45
3456 $15.89 14
2341 $25.87 32
I need to use a command to show who is getting paid the highest amount to standard output. I am not sure if I should use a sort command or a copy and paste... (1 Reply)
Discussion started by: drew211
1 Replies
LEARN ABOUT LINUX
dbiprof
DBIPROF(1p) User Contributed Perl Documentation DBIPROF(1p)NAME
dbiprof - command-line client for DBI::ProfileData
SYNOPSIS
See a report of the ten queries with the longest total runtime in the profile dump file prof1.out:
dbiprof prof1.out
See the top 10 most frequently run queries in the profile file dbi.prof (the default):
dbiprof --sort count
See the same report with 15 entries:
dbiprof --sort count --number 15
DESCRIPTION
This tool is a command-line client for the DBI::ProfileData. It allows you to analyze the profile data file produced by DBI::ProfileDumper
and produce various useful reports.
OPTIONS
This program accepts the following options:
--number N
Produce this many items in the report. Defaults to 10. If set to "all" then all results are shown.
--sort field
Sort results by the given field. Sorting by multiple fields isn't currently supported (patches welcome). The available sort fields
are:
total
Sorts by total time run time across all runs. This is the default sort.
longest
Sorts by the longest single run.
count
Sorts by total number of runs.
first
Sorts by the time taken in the first run.
shortest
Sorts by the shortest single run.
key1
Sorts by the value of the first element in the Path, which should be numeric. You can also sort by "key2" and "key3".
--reverse
Reverses the selected sort. For example, to see a report of the shortest overall time:
dbiprof --sort total --reverse
--match keyN=value
Consider only items where the specified key matches the given value. Keys are numbered from 1. For example, let's say you used a
DBI::Profile Path of:
[ DBIprofile_Statement, DBIprofile_Methodname ]
And called dbiprof as in:
dbiprof --match key2=execute
Your report would only show execute queries, leaving out prepares, fetches, etc.
If the value given starts and ends with slashes ("/") then it will be treated as a regular expression. For example, to only include
SELECT queries where key1 is the statement:
dbiprof --match key1=/^SELECT/
By default the match expression is matched case-insensitively, but this can be changed with the --case-sensitive option.
--exclude keyN=value
Remove items for where the specified key matches the given value. For example, to exclude all prepare entries where key2 is the method
name:
dbiprof --exclude key2=prepare
Like "--match", If the value given starts and ends with slashes ("/") then it will be treated as a regular expression. For example, to
exclude UPDATE queries where key1 is the statement:
dbiprof --match key1=/^UPDATE/
By default the exclude expression is matched case-insensitively, but this can be changed with the --case-sensitive option.
--case-sensitive
Using this option causes --match and --exclude to work case-sensitively. Defaults to off.
--delete
Sets the "DeleteFiles" option to DBI::ProfileData which causes the files to be deleted after reading. See DBI::ProfileData for more
details.
--dumpnodes
Print the list of nodes in the form of a perl data structure. Use the "-sort" option if you want the list sorted.
--version
Print the dbiprof version number and exit.
AUTHOR
Sam Tregar <sam@tregar.com>
COPYRIGHT AND LICENSE
Copyright (C) 2002 Sam Tregar
This program is free software; you can redistribute it and/or modify it under the same terms as Perl 5 itself.
SEE ALSO
DBI::ProfileDumper, DBI::Profile, DBI.
perl v5.12.3 2011-05-06 DBIPROF(1p)