Any 'shortcut' to doing this search for duplicate and print max
Hi,
I have a file that contains multiple records of the same database.
I need to search for the maximum size of the database. At the moment, I am doing as below:
Sample generated file to parse is as below. With the caret (^) delimiter, field 1 is the database name, 2 is the database ID and the field4 is the database size.
Excerpt of the script that I use to parse /tmp/x.txt is as below:
Sample run of the script is as below:
Then I've been informed that ideally, what constitute a unique database is a concatenation of field1+ field2.
So if the file to parse, /tmp/x1.txt, is as below. There is actually two databases named TEST11, each having a different database IDs and two databases named QUAL11.
So the script that I am using now then is the one below:
Sample run of x1.ksh looks good.
At the moment, I am getting the desired output but just want to know if there is a shortcut way of doing it.
BTW, need to run the script in KSH in Solaris and Linux.
HI all
I'm trying to write an awk script to print the min and max value in a range(s) contained in another file - the range values are in $2
EG
114,7964,1,y,y,n
114,7965,1,y,y,n
114,7966,1,y,y,n
114,7967,1,y,y,n
114,7969,1,y,y,n
114,7970,1,y,y,n
114,7971,1,y,y,n
114,7972,1,y,y,n... (3 Replies)
Is it possible to print max number of 2 columns - awk
note: print max if the integer is positive and print min if the integer is negative
input
a 1 2
b 3 4
c 5 1
d -3 -5
d -5 -3
output
a 2
b 4
c 5
d -5
d -5 (4 Replies)
Hi all,
plz help me with this, I want to to extract the duplicate rows (column 1) in a file which at least repeat 4 times. then I want to summarize them by getting the max , mean, median and min. The file is sorted by column 1, all the repeated rows appear together.
If number of elements is... (5 Replies)
Hi,
I've written a script to search for an Oracle ORA- error on a log file, print that line and the .trc file associated with it as well as the dateline of when I assumed the error occured. In most it is the first dateline previous to the error.
Unfortunately, this is not a fool proof script.... (2 Replies)
Hi to all,
Please help on the following problem, I'm not where to begin, if awk or shell script.
I have pairs of ranges of numbers and I need to find the root or roots of ranges based on min Range and Max ranges
Example #1:
If min range is 120000 and max ranges 124999, it means that are... (5 Replies)
I need to find the max value of all columns except the 1st column and print the answer along with the 1st column.
Input
123xyz 0 0 1 2 0 0 0 0 0 0 0
234xyz 0 0 0 0 0 0 0 0 0 0 0
345xyz 0 0 1 0 0 0 ... (8 Replies)